Skip to content

Commit

Permalink
Merge pull request #1 from smithalexk/smithalexk-pad-weeks
Browse files Browse the repository at this point in the history
Adding padding for the weeks (W)
  • Loading branch information
smithalexk authored Jan 20, 2021
2 parents 76482b3 + 8d330b1 commit bbff4d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dateformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

(function (global) {
const dateFormat = (() => {
const token = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LlopSZWN]|"[^"]*"|'[^']*'/g;
const token = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g;
const timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;
const timezoneClip = /[^-+\dA-Z]/g;

Expand Down Expand Up @@ -141,6 +141,7 @@
d() % 10 > 3 ? 0 : (((d() % 100) - (d() % 10) != 10) * d()) % 10
],
W: () => W(),
WW: () => pad( W() ),
N: () => N(),
};

Expand Down

0 comments on commit bbff4d8

Please sign in to comment.