mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2025-12-06 02:30:46 -08:00
Refine date format tokens for weekday number, and add support for day of year
See discussion at https://groups.google.com/g/tiddlywiki/c/tf23ByDXzxM/m/5Wx7PV36AwAJ
This commit is contained in:
parent
de33b365ae
commit
f223896c26
2 changed files with 10 additions and 2 deletions
|
|
@ -383,12 +383,18 @@ exports.formatDateString = function(date,template) {
|
|||
[/^0WW/, function() {
|
||||
return $tw.utils.pad($tw.utils.getWeek(date));
|
||||
}],
|
||||
[/^0dddd/, function() {
|
||||
return $tw.utils.pad(Math.floor((date - new Date(date.getFullYear(), 0, 0)) / 1000 / 60 / 60 / 24),3);
|
||||
}],
|
||||
[/^dddd/, function() {
|
||||
return [7,1,2,3,4,5,6][date.getDay()];
|
||||
return Math.floor((date - new Date(date.getFullYear(), 0, 0)) / 1000 / 60 / 60 / 24);
|
||||
}],
|
||||
[/^ddd/, function() {
|
||||
return $tw.language.getString("Date/Short/Day/" + date.getDay());
|
||||
}],
|
||||
[/^dd/, function() {
|
||||
return [7,1,2,3,4,5,6][date.getDay()];
|
||||
}],
|
||||
[/^mmm/, function() {
|
||||
return $tw.language.getString("Date/Short/Month/" + (date.getMonth() + 1));
|
||||
}],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue