-
Notifications
You must be signed in to change notification settings - Fork 445
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
Additional Support for Date Time pattern formats #347
Conversation
Current coverage is
|
Current coverage is
|
Can you remove the merge commit from this PR? It should be as easy as git remote add upstream https://github.com/python-babel/babel.git
git fetch --all
git rebase upstream/master |
9acb7de
to
8aacd89
Compare
width = {3: 'abbreviated', 4: 'wide', 5: 'narrow'}[num] | ||
context = {3: 'format', 4: 'format', 5: 'stand-alone'}[num] | ||
width = {3: 'abbreviated', 4: 'wide', 5: 'narrow', 6: 'short'}[num] | ||
if char == 'c': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some sort of reference about the semantics of lower-case c
using stand-alone context? It doesn't seem immediately obvious, esp. considering this is a format function...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akx I screwed up the commit once again. Please help
I will work on it on Monday |
doing
seems to untangle the history enough. You can then do |
2418472
to
9bfe3aa
Compare
@akx Made some changes, please check |
@@ -155,6 +160,28 @@ def test_local_day_of_week_standalone(self): | |||
fmt = dates.DateTimeFormat(d, locale='bn_BD') | |||
self.assertEqual('4', fmt['c']) # friday is first day of week | |||
|
|||
def test_pattern_day_of_week(self): | |||
dt = datetime(2016,2,6) | |||
fmt = dates.DateTimeFormat(dt, locale='en_US') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to see the "local day of week" formats (e
and c
) being tested with a locale that has another start-of-week-day than en_US
's Sunday.
Otherwise, this PR looks very good!
Added test cases and additional pattern for quarter format
Added test cases and additional pattern for Weekday format
Nice work! Thanks @sachinpali146 :) |
Additional Support for Date Time pattern formats
No description provided.