-
-
Notifications
You must be signed in to change notification settings - Fork 704
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 timezone support to clock module (closes #223) #560
Conversation
Here are the issues I discovered:
|
From what I see here there is a version of |
I like this idea, but after noodling with it for a bit my C++ just isn't up to the task :(. My thinking was having a new struct containing a localtime and locale that gets passed to the |
@Alexays I think we have reached the full set of desirable functionalities. Could you have a second look to check C++ style ? |
zone = date::locate_zone(config_["timezone"].asString()); | ||
} else { | ||
zone = date::current_zone(); | ||
if (!fixed_time_zone_) { |
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.
Why not just use !config_["timezone"].isString()
and removing fixed_time_zone_
var?
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.
To avoid going through the json parser each time. May not be worth it.
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.
The json is already parsed, but yeah, never mind.
LGTM Thanks guys ! ❤️ |
@Alexays Have updated the patch URL to be github as well, and rewrote history a little bit to use my personal (rather than work) email on the commits. Let me know if you'd like me to rewrite the history/squash commits at all. |
Thanks guys, great work 👍 |
Will wiki page update? |
Man page is updated, but the wiki still need to be updated, @mjec can you give a shot? |
Just updated the wiki @Alexays |
Yes @Nerddan, with a config like: {
"modules-right": ["clock#nyc", "clock#sydney"],
"clock#nyc": {
"timezone": "America/New_York"
},
"clock#sydney": {
"timezone": "Australia/Sydney"
}
} |
When will this be packed into the next release? |
@Nerddan By the end of the week |
Please forgive my C++ newbiness!
Notably I had to do the subprojects thing to get around HowardHinnant/date#398, and I don't love that I had to write my own formatter in clock.cpp, but I think this should work.
Feedback, and push back, very welcome. Let me know how to improve the code and I will!