Closed nareshbhatia closed 11 years ago
example?
var tzdate = new timezoneJS.Date(new Date(), 'America/Chicago');
console.log(tzdate.toString('hh:mm:ss k Z')); // puts out 'hh'
console.log(tzdate.toString('HH:mm:ss k Z')); // works fine
I looked at the code for toString(), there is a case for 'H" but nothing for 'h'.
Hmm can't seem to reproduce it. Are you sure you have the latest greatest git master? We haven't released the version that supports 'h' yet. Check out https://github.com/mde/timezone-js/blob/master/spec/date.spec.js last test you'll see an example
Aha, I am using the latest tagged version (0.4.4) - that explains it.
How do I build the master branch? Haven't used Jake before, but when I run it, I get the following error:
$ jake test jake aborted. Error: 'jasmine-node' is not recognized as an internal or external command. operable program or batch file. (See full trace by running task with --trace)
@mde can you push 0.4.5?
v0.4.5 published.
Works like a charm! Thank you.
In issue #83, it was mentioned that toString() supports the following tokens:
y: year d: date m: minute s: second S: millisecond M: month. Note: MM will be the numeric representation (e.g February is 02) but MMM will be text representation (e.g February is Feb) k: AM/PM H: hour 'h': 12 hour format E: day Z: timezone abbreviation
I tried to use the 'h' token today and it is completely ignored (the output simply shows the letter 'h').