Fixed formatDate month shortform
This commit is contained in:
parent
ce3c8d012a
commit
ff4401934c
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ztimson/utils",
|
"name": "@ztimson/utils",
|
||||||
"version": "0.22.9",
|
"version": "0.22.10",
|
||||||
"description": "Utility library",
|
"description": "Utility library",
|
||||||
"author": "Zak Timson",
|
"author": "Zak Timson",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -100,7 +100,7 @@ export function formatDate(date: Date | number | string, format = 'YYYY-MM-DD H:
|
|||||||
.replaceAll('YY', date.getFullYear().toString().slice(2))
|
.replaceAll('YY', date.getFullYear().toString().slice(2))
|
||||||
// Month
|
// Month
|
||||||
.replaceAll('MMMM', month(date.getMonth()))
|
.replaceAll('MMMM', month(date.getMonth()))
|
||||||
.replaceAll('MMM', month(date.getMonth()).slice(0, 2))
|
.replaceAll('MMM', month(date.getMonth()).slice(0, 3))
|
||||||
.replaceAll('MM', (date.getMonth() + 1).toString().padStart(2, '0'))
|
.replaceAll('MM', (date.getMonth() + 1).toString().padStart(2, '0'))
|
||||||
.replaceAll('M', (date.getMonth() + 1).toString())
|
.replaceAll('M', (date.getMonth() + 1).toString())
|
||||||
// Day
|
// Day
|
||||||
|
Loading…
Reference in New Issue
Block a user