-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for "week of month" in SimpleDateTimeFormatter #11103
Add support for "week of month" in SimpleDateTimeFormatter #11103
Conversation
✅ Deploy Preview for meta-velox canceled.
|
4a95917
to
a3205d0
Compare
@rui-mo Could you help to review this PR please? Thanks. |
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.
Thanks. Looks good to me overall.
@rui-mo I've updated code based on the feedback. Could you review it again? Thanks. |
@mbasmanova Could you help to review this PR please? Thanks. |
cc: @pedroerp |
@mbasmanova @pedroerp Just a gentle ping. |
bool centuryFormat = false; | ||
|
||
bool isYearOfEra = false; // Year of era cannot be zero or negative. | ||
bool hasYear = false; // Whether year was explicitly specified. | ||
bool hasDayOfWeek = false; // Whether dayOfWeek was explicitly specified. |
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.
unrelated to this PR, but maybe we should use std::optional
to prevent these flags controlling what has been explicitly set and what not.
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.
Thanks for your suggestion! Using std::optional would be a more elegant solution to avoid using boolean flags to control whether a value has been explicitly set. I'd like to work on it. Should I open an issue for this first?
@pedroerp has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@NEUpanning sorry I was on PTO last few weeks. @rui-mo assuming this one is also ready to merge? |
@pedroerp Yes, it looks good AFAICS. |
Summary: #11103 breaks GCC build ``` In instantiation of function template specialization 'facebook::velox::functions::(anonymous namespace)::padContent<double>' call to 'to_chars' is ambiguous ``` To minimize code changes, this PR add unsigned cast for ceil to fix it. Pull Request resolved: #11369 Reviewed By: Yuhta Differential Revision: D65420211 Pulled By: mbasmanova fbshipit-source-id: 18aba3a62012a86d1bc3e7fec57dda54c992050e
java.text.SimpleDateFormat
supports using 'week of month' to parse/formatdate. The specifier of 'week of month' is 'W'. Now DateTimeFormatter supports 3
group of fields specifying the day within the year. They are following
combinations:
This PR introduces a new combination that is
year + month + weekOfMonth + dayOfWeek
and adds support for "week of month"in SimpleDateTimeFormatter.
Relates issue : #10354