diff --git a/package.json b/package.json index 6420413..ba26a8a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/time.ts b/src/time.ts index 439249b..20cb6c1 100644 --- a/src/time.ts +++ b/src/time.ts @@ -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(),