-
Stop using
let
to avoid breaking backwards compatibility with ES5. Thanks to Maximilian Herold for the report #87 -
Drop '份' suffix from Chinese month names. Thanks to @mogando668 for the report #88
-
Fix test case for %c in current versions of node.js
-
Fix %-y so it omits the leading zero
Thanks to Aryan Arora for both fixes!
-
Fix it_IT shortMonths locale Thanks to Douglas de Espindola
-
Try to get a short time zone name for %Z, falling back to the long one. This attempts to work around a change to Date.toString in v8 (node v10+, Chrome 66+). Unfortunately sometimes Date.toLocaleString returns a time zone like GMT+2 and we fall back to the long name in that case.
-
Remove the old API deprecated in v0.9.
-
Bundle some locales that you can use with
strftime.localizeByIdentifier('nl_NL')
. Full list available in the readme. Thanks to Andrew Pirondini of iFixit -
Add instructions to install with Yarn. Thanks to Ayman Nedjmeddine
-
Unrecognized format specifiers preserve the % sign, e.g.
strftime('%K') => "%K"
. Thanks to Kevin Jin -
Make
strftime
work with dates that have been extended by DateJS. Thanks to Stian Grytøyr -
Add instructions to install with Yarn. Thanks to Ayman Nedjmeddine
-
Fix UTC formatting of dates that cross a DST boundary. Thanks to ray007
-
Allow localizing ordinals. Thanks to Simon Liétar
-
fix a caching bug, which was a regression in 0.9.0 (issue #63)
-
update license attribute in package.json as required by npm Thanks to Peter deHaan
-
construct GMT times used in tests in a more robust way
-
fix a bug calculating week numbers (issue #56) Thanks to Alexandr Nikitin
-
warn about possible misuse of %:: or %::: modifiers
-
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
%z
with 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
%e
which is supposed to be padded with a space
-
fix
%Z
when the timezone contains spaces Thanks to w0den -
fix examples using
%Y
in 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
TZ
is empty and the system timezone is not PST/PDT
- add support for passing in explicit timezones with
strftimeTZ
which accepts numeric offsets from GMT, in minutes
- expose
strftimeUTC
andlocalizedStrftime
properly in browsers
- fix a bug where
RequiredDateMethods
was created as a global
- add
%o
to 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
getLocalizedStrftime
function -
make
%C
pad 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
%z
for timezones greater than GMT -
support any
Date
-like objects instead of checking for actual instances ofDate
-
add week numbers
%U
and%W
-
add support for component Thanks to TJ Holowaychuk
- add
%j
and%C
, thanks to Ryan Stafford
-
add
%P
which is "am" or "pm", like%p
but lowercase (this makes no sense, and I am sorry for propagating this madness) Thanks to Rob Colburn -
export the
strftime
function 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
%L
for 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
%s
which is seconds since the Unix epoch, but was in milliseconds -
add
%L
for 3-digit milliseconds
-
add
strftimeUTC
for ignoring timezones Thanks to Andrew Schaaf -
support exporting to the top level object in ES5 strict mode
- fix
%y
for 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.replace
instead of afor
loop
Initial release.