Skip to content

Commit

Permalink
fix: 12h
Browse files Browse the repository at this point in the history
  • Loading branch information
badosz0 committed Jan 3, 2024
1 parent c1d8714 commit c6b19b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "holy-time",
"version": "3.4.0",
"version": "3.4.1",
"description": "Utility functions",
"repository": "Yet another (type-safe) date time library",
"main": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ export class HolyTime {
DD: date.getDate().toString().padStart(2, '0'),
HH: date.getHours().toString().padStart(2, '0'),
H: date.getHours().toString(),
h: (date.getHours() % 12).toString(),
hh: (date.getHours() % 12).toString().padStart(2, '0'),
hh: (date.getHours() % 12 ? (date.getHours() % 12) : 12).toString().padStart(2, '0'),
h: (date.getHours() % 12 ? (date.getHours() % 12) : 12).toString(),
A: date.getHours() >= 12 ? 'PM' : 'AM',
a: date.getHours() >= 12 ? 'pm' : 'am',
m: date.getMinutes().toString(),
Expand Down

0 comments on commit c6b19b0

Please sign in to comment.