Skip to content

Commit

Permalink
fix: alias template to Hour, Minute, Second and Millisecond.
Browse files Browse the repository at this point in the history
  • Loading branch information
JonDotsoy committed Jul 14, 2023
1 parent cf168e2 commit b7a87d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ ndate --template '{{YYYY}}{{MM}}{{DD}}{{HH}}{{MM}}{{SS}}{{MS}}' # 20233014203059
- `{{YYYY}}`: Full year in local time. Ej. `2023`.
- `{{MM}}`: Month in local time. Ej. `07`, `12`.
- `{{DD}}`: Day of month in local time. Ej. `09`, `31`.
- `{{HH}}`: Hour in local time. Ej. `06`, `18`.
- `{{MM}}`: Minute in local time. Ej. `23`, `59`.
- `{{SS}}`: Second in local time. Ej. `13`, `30`.
- `{{MS}}`: Millisecond in local time. Ej. `0456`, `998`.
- `{{hh}}`: Hour in local time. Ej. `06`, `18`.
- `{{mm}}`: Minute in local time. Ej. `23`, `59`.
- `{{ss}}`: Second in local time. Ej. `13`, `30`.
- `{{ms}}`: Millisecond in local time. Ej. `0456`, `998`.


**Sample**
Expand Down
8 changes: 4 additions & 4 deletions ndate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ function renderDateTemplate(template: string, date: Date, locales?: string, opti
["MM", (date.getMonth() + 1).toString().padStart(2,`0`)],
["DD", date.getDate().toString().padStart(2,`0`)],

["HH", date.getHours().toString().padStart(2,`0`)],
["MM", date.getMinutes().toString().padStart(2,`0`)],
["SS", date.getSeconds().toString().padStart(2,`0`)],
["MS", date.getMilliseconds().toString().padStart(4,`0`)],
["hh", date.getHours().toString().padStart(2,`0`)],
["mm", date.getMinutes().toString().padStart(2,`0`)],
["ss", date.getSeconds().toString().padStart(2,`0`)],
["ms", date.getMilliseconds().toString().padStart(4,`0`)],


["full_year", date.getFullYear()],
Expand Down

0 comments on commit b7a87d7

Please sign in to comment.