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
date/strftime #83
date/strftime #83
Conversation
|
||
it('should support multiple tokens at once', function () { | ||
// iso8601 | ||
expect( strftime(date, '%Y-%m-%dT%H:%M:%S%z') ).toEqual( '2013-04-08T09:02:04-0300' ); |
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.
ops, we need to remove the %z
otherwise test will fail if timezoneOffset
is different..
I'm wondering if we should split each It will probably make things easier to reuse and can make code cleaner in some cases (eg. while building a calendar you probably need |
implementation is covering all the tokens from http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html besides I extracted all the formats that aren't one-liners into separate modules and kept the localization info as a separate file, that way we could potentially create multiple i18n files inside the date package.
|
I'm almost merging this without the ISO week number support ( Anyone against an incomplete implementation of /cc @conradz @MathiasPaumgarten @leocavalcante |
Sorry, I've been a little lazy on this PR since it's quite a junk of code to read through. I have no objections at all. A welcomed feature for sure, I was just keeping quiet since I never got around to check out the PR closely. Shame on me. Anyways 👍 and looking forward to 0.6.0! |
I would be OK with an incomplete implementation, as long as the incomplete parts (parts implemented in the C |
I rewrote the whole commit history (so it makes more sense) and added docs to all the new methods. I also marked the I think it's good to merge, planning to do it tomorrow and release v0.6 after that. |
I will add a de-DE version once it's merged, so I can pull and create e PR. |
date: strftime, dayOfTheYear, timezoneOffset, timezoneAbbr, weekOfTheYear. improve number/pad.
started date/strftime implementation.
following the tokens present on python, ruby and C
still missing some stuff but basic features are working.. I also added an internal
date/i18n_
module to allow setting the locale globally but I guess we need another option to override the default locale as well (maybe 3rd argument).see #78