is_date_format gives incorrect results

11 views
Skip to first unread message

snoo...@gmail.com

unread,
Jan 3, 2023, 4:30:18 PM1/3/23
to openpyxl-users
openpyxl.styles.numbers.is_date_format('ha/p\\m') returns False instead of True.  It's checking that the second character is a date format character, not the first character.  It needs to use a negative look-behind assertion to check that the prior char is not a backslash.
--joe

Charlie Clark

unread,
Jan 4, 2023, 4:54:26 AM1/4/23
to openpyxl-users
Thanks for the report. Do you fancy submitting a PR (on the 3.1 branch) with a test and fix?

Charlie

--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Sengelsweg 34
Düsseldorf
D- 40489
Tel: +49-203-3925-0390
Mobile: +49-178-782-6226

Joe Cool

unread,
Jan 6, 2023, 9:43:36 AM1/6/23
to openpyx...@googlegroups.com

--
You received this message because you are subscribed to a topic in the Google Groups "openpyxl-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpyxl-users/BFtSBSuvXFw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpyxl-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpyxl-users/5F848919-0B0F-4FFD-A509-B71E98A68D67%40clark-consulting.eu.
Reply all
Reply to author
Forward
0 new messages