mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-17 12:01:33 +02:00
docs: update comments in theme guides and configuration files
This commit is contained in:
parent
bf20fb4014
commit
b72b59358b
9 changed files with 83 additions and 165 deletions
|
@ -21,19 +21,19 @@ function formatDate(date: Date, format: 'YYYY-MM-DD' | 'MM-DD-YYYY' | 'DD-MM-YYY
|
|||
}
|
||||
|
||||
switch (format) {
|
||||
// ISO format: 2024-03-04
|
||||
// ISO format: 2025-04-13
|
||||
case 'YYYY-MM-DD':
|
||||
return date.toISOString().split('T')[0]
|
||||
|
||||
// US date format: 03-04-2024
|
||||
// US date format: 04-13-2025
|
||||
case 'MM-DD-YYYY':
|
||||
return date.toLocaleDateString('en-US', options).replace(/\//g, '-')
|
||||
|
||||
// European date format: 04-03-2024
|
||||
// European date format: 13-04-2025
|
||||
case 'DD-MM-YYYY':
|
||||
return date.toLocaleDateString('en-GB', options).replace(/\//g, '-')
|
||||
|
||||
// US month text format: Mar 4 2024
|
||||
// US month text format: Mar 13 2025
|
||||
case 'MONTH DAY YYYY':
|
||||
return date.toLocaleDateString('en-US', {
|
||||
year: 'numeric',
|
||||
|
@ -41,7 +41,7 @@ function formatDate(date: Date, format: 'YYYY-MM-DD' | 'MM-DD-YYYY' | 'DD-MM-YYY
|
|||
day: 'numeric',
|
||||
}).replace(',', '')
|
||||
|
||||
// British month text format: 4 Mar 2024
|
||||
// British month text format: 13 Mar 2025
|
||||
case 'DAY MONTH YYYY':
|
||||
return date.toLocaleDateString('en-GB', {
|
||||
year: 'numeric',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue