-
Notifications
You must be signed in to change notification settings - Fork 1
Implement strftime #12
Conversation
lopopolo
left a comment
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 working on this @x-hgg-x! I'm excited to see where this goes.
Just to clarify, is your intent to match the behavior of all the time specifiers found in https://github.com/artichoke/strftime-ruby/blob/trunk/vendor/ruby-3.1.2/strftime.c?
|
Yes, I use the specification at https://ruby-doc.org/core-3.1.2/Time.html#method-i-strftime, with verification using the interpreter. |
|
Awesome thank you! |
|
Potential inconsistency with Ruby 3.1.2: Time.new(2021,10,21,1,1,1,'Z').wday # 7 (Sunday)
Time.at(Time.new(2021,10,21,1,1,1,'Z'), in: 'Z').wday # 4 (Thursday) |
|
It seems that many specifiers are invalid when the time zone is UTC: Time.new(2019,12,31,12,1,1,'Z').strftime("%G %g %V %U %W %u %w %j %a %A") # "2019 19 00 00 00 7 6 001 ? ?"
Time.new(2019,12,31,12,1,1,'A').strftime("%G %g %V %U %W %u %w %j %a %A") # "2020 20 01 52 52 2 2 365 Tue Tuesday" |
yea something weird is going on there: |
Adding some more examples of this weirdness: |
I'm taking a guess here but I bet Regardless, I think what |
lopopolo
left a comment
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.
this is looking great so far!
|
The doc of
|
Bug and PR to fix this: |
|
Fix is merged in artichoke/artichoke@17e469b. |
This comment was marked as resolved.
This comment was marked as resolved.
lopopolo
left a comment
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.
Thank you so much for the PR @x-hgg-x.
Sorry for the boatload of comments, but this code is tricky and I want to make sure I grok the implementation.
I'd love to grant you commit rights to this repository if that's something you'd be open to. Let me know what you'd like me to do there.
I'll hold off on any more reviewing until you move the PR out of draft to "ready for review".
Thanks again!
lopopolo
left a comment
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.
tweaks to get the docs to build without std feature.
|
I can prep the release after the tests pass and this gets merged. ooc, given that a trait is part of the public API, should we release as 1.0.0? |
|
I think the API is pretty complete at this point, so this should be ok. |
lopopolo
left a comment
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 have a couple of questions. Apart from the suspicious calculation of size_limit, this looks good to go.
Once all of the conversations are resolved, I'll merge this PR.
Huge thank you @x-hgg-x. This is some amazing work.
lopopolo
left a comment
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.
This looks great. Now that #15 is merged, the MSRV check should pass. Please rebase and then I'll merge.
|
🎉 @x-hgg-x thank you again so much. I'll make you a maintainer here later today when I'm done with work. There are a few changes I'd like to try and make, e.g. removing the bitflags dep. I'll tag you as a reviewer. Hopefully we can push out a 1.0 by the end of this week or next. |
Implement strftime.