Skip to content

Commit

Permalink
Optimisations to time. Use valueOf and stringOf - the world is not ye…
Browse files Browse the repository at this point in the history
…t ready for toPrimitive symbols
  • Loading branch information
stephband committed Jan 5, 2017
1 parent c00242f commit c921b12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@
YYYY: function(date) { return ('000' + date.getFullYear()).slice(-4); },
YY: function(date) { return ('0' + date.getFullYear() % 100).slice(-2); },
MM: function(date) { return ('0' + (date.getMonth() + 1)).slice(-2); },
MMM: function(date) { return this.MMMM(date).slice(0,3); },
MMM: function(date, lang) { return this.MMMM(date, lang).slice(0,3); },
MMMM: function(date, lang) { return locales[lang || Time.lang].months[date.getMonth()]; },
D: function(date) { return '' + date.getDate(); },
DD: function(date) { return ('0' + date.getDate()).slice(-2); },
ddd: function(date) { return this.dddd(date).slice(0,3); },
ddd: function(date, lang) { return this.dddd(date, lang).slice(0,3); },
dddd: function(date, lang) { return locales[lang || Time.lang].days[date.getDay()]; },
HH: function(date) { return ('0' + date.getHours()).slice(-2); },
hh: function(date) { return ('0' + date.getHours() % 12).slice(-2); },
Expand Down

0 comments on commit c921b12

Please sign in to comment.