-
re-fix issue #38 which was lost in the v0.9 merge
-
add this changelog
This release marks the final run up to v1.0, which should be released by March 2016.
The headline feature is a huge performance boost resulting from this contest. Alexandr Nikitin has essentially rewritten the code and the results speak for themselves.
Along with this the API has been unified and cleaned up. strftimeTZ, strftimeUTC, and localizedStrftime have all been deprecated in favour of the following functions: timezone(tz), utc(), and localize(locale). You use them like so:
var strftime = require('strftime'); // not required in web browsers
var strftimeIT = strftime.localize(anItalianLocale);
var strftimePST = strftime.timezone('-0800');
var strftimeUTC = strftime.utc();
// You can combine them
var strftimeIT_PST = strftimeIT.timezone('-0800');
// And chain them all at once
var strftimeIT_PST = strftime.localize(anItalianLocale).timezone('-0800');The previous API is deprecated and will be removed for v1.0. The good news is that the previous API is supported by adapting the new API, so you get most of the performance benefits before you even update your code to use the new API.
The new API does not support passing in a custom timezone or locale on each call to strftime. This is a regression so if you really need this use case let us know and we'll figure something out.
Thanks to all contributors that have helped to improve this library over the past 4 years.
-
fix conversion of dates to UTC Thanks to Alexandr Nikitin
-
extend
%zwith a colon separator in timezone offsets,"[+-]HH:MM"Thanks to Cory Heslip -
ignore irrelevant files in bower.json
First release for Bower, and only released for Bower.
- fix
%ewhich is supposed to be padded with a space
-
fix
%Zwhen the timezone contains spaces Thanks to w0den -
fix examples using
%Yin the readme Thanks to Ryan Regalado -
fix a bug when specifying minutes in the timezone Thanks to Alexandr Nikitin
-
allow timezones to be specified as strings of the form
"+0100"or"-0800"([+-]HHMM) -
fix a bug running tests where the environment variable
TZis empty and the system timezone is not PST/PDT
- add support for passing in explicit timezones with
strftimeTZwhich accepts numeric offsets from GMT, in minutes
- expose
strftimeUTCandlocalizedStrftimeproperly in browsers
- fix a bug where
RequiredDateMethodswas created as a global
- add
%oto get the day of the month as an ordinal (in English)
-
add some Ruby extension prefixes:
-,_, and0, and they work like so:strftime('%-d') // => "7"strftime('%_d') // => " 7"strftime('%0d') // => "07" -
fix padding the day-of-year in
%j -
add a minified version of the code to the repo for easy distribution with some package managers
-
remove deprecated
getLocalizedStrftimefunction -
make
%Cpad the century with spaces, like C -
list all supported specifiers in the readme, it's no longer fair to say "look at
man 3 strftime" -
use fixed dates in the readme instead of "now", so people can execute the examples and see the same results Thanks to John Zwinck
-
fix
%zfor timezones greater than GMT -
support any
Date-like objects instead of checking for actual instances ofDate
-
add week numbers
%Uand%W -
add support for component Thanks to TJ Holowaychuk
- add
%jand%C, thanks to Ryan Stafford
-
add
%Pwhich is "am" or "pm", like%pbut lowercase (this makes no sense, and I am sorry for propagating this madness) Thanks to Rob Colburn -
export the
strftimefunction directly in node so you can writestrftime = require('strftime')instead ofstrftime = require('strftime').strftime -
added contributors to the readme and package.json
-
rename
getLocalizedStrftime(locale)tolocalizedStrftime(locale)The old name is deprecated and will stick around until v0.5 or v0.6. -
add tests for locales
-
fix the sign of
%z, which is something like "+0100" or "-0800" ([+-]HHMM) -
improve test coverage
-
fix
%Lfor values < 100 -
convert tests from CoffeeScript to JavaScript (nothing personal, just keeping the dependencies trim)
This release was all Andrew Schaaf.
-
add some tests
-
fix
%swhich is seconds since the Unix epoch, but was in milliseconds -
add
%Lfor 3-digit milliseconds
-
add
strftimeUTCfor ignoring timezones
Thanks to Andrew Schaaf -
support exporting to the top level object in ES5 strict mode
- fix
%yfor years outside the range [1900, 2099]
- add support for localization
- fix export for browsers
- set required node version to 0.2 instead of 0.3 in package.json
- fix module export
- bug fix for recursive formats
- use
String.prototype.replaceinstead of aforloop
Initial release.