-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support %B directive for strptime #91
Comments
to clarify by different locale you mean it should also behave like this?
it meant to be "day j_month year" but persian name was moved to last in editor |
the the request should be : jdatetime.datetime.strptime('۱۴ خرداد ۱۴۰۰', '%d %B %Y') # the string is in : day month-name year
jdatetime.datetime.strptime('14 Khordad 1400, "%d %B %Y") My question was if we should support mix of English and Persian chars like: jdatetime.datetime.strptime('14 خرداد 1400', '%d %B %Y') And if yes, how would it be implemented? |
I think python 3 can cast Unicode numbers to integer.
but current regex patterns won't detect Persian numbers.
with this pattern it can detect any combination of numbers for example all of these now are acceptable.
we do the same for %B. pattern below detects all en_j_months pattern:
now it can detect Persian words but we need to map these names to a number so after regex we try to detect if %b or %B is used and if it is used we check if its ASCII or not to use the list of month names in date class to map them to a number:
this should work for all the instances below:
ps: |
Deployed as part of v4.1.0 |
We want to support
%B
and%b
directive in strptime function:This directive is supported in
datetime
module:Expected behaviour:
Open questions:
The text was updated successfully, but these errors were encountered: