mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-04 13:19:11 +00:00
Add new date format tokens for weekday number
See https://en.wikipedia.org/wiki/ISO_8601#Week_dates
This commit is contained in:
parent
1491339f50
commit
f70cee6907
@ -383,6 +383,9 @@ exports.formatDateString = function(date,template) {
|
||||
[/^0WW/, function() {
|
||||
return $tw.utils.pad($tw.utils.getWeek(date));
|
||||
}],
|
||||
[/^dddd/, function() {
|
||||
return [7,1,2,3,4,5,6][date.getDay()];
|
||||
}],
|
||||
[/^ddd/, function() {
|
||||
return $tw.language.getString("Date/Short/Day/" + date.getDay());
|
||||
}],
|
||||
|
@ -1,5 +1,5 @@
|
||||
created: 20140418142957325
|
||||
modified: 20201201154521138
|
||||
modified: 20210912115121622
|
||||
tags: Features
|
||||
title: DateFormat
|
||||
type: text/vnd.tiddlywiki
|
||||
@ -9,6 +9,7 @@ When used to display date values (with the `format` attribute set to ''date''),
|
||||
|!Token |!Substituted Value |
|
||||
|`DDD` |Day of week in full (eg, "Monday") |
|
||||
|`ddd` |Short day of week (eg, "Mon") |
|
||||
|`dddd` |<<.from-version "5.2.0">> Weekday number from 1 through 7, beginning with Monday and ending with Sunday |
|
||||
|`DD` |Day of month |
|
||||
|`0DD` |Adds a leading zero |
|
||||
|`DDth` |Adds a suffix |
|
||||
|
Loading…
Reference in New Issue
Block a user