Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DateFormat.tid #6186

Merged
merged 1 commit into from Nov 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion editions/tw5.com/tiddlers/features/DateFormat.tid
Expand Up @@ -4,7 +4,13 @@ tags: Features
title: DateFormat
type: text/vnd.tiddlywiki

When used to display date values (with the `format` attribute set to ''date''), the ViewWidget accepts a `template` attribute that allows the format of the date values to be specified. The format string is processed with the following substitutions:
The default representation of dates is a compact string such as `20211002153802059`. For example, the `created` and `modified` fields are stored like this.

The display format for this string can be controlled with a template. For example, transcluding the `modified` field automatically applies a template to display the date as `Sat Oct 02 2021 17:40:50 GMT+0200 (Central European Summer Time)`. A few widgets and filter operators allow you to manually specify a template, for example the ViewWidget:

`<$view field=modified format=date template=“DDth mmm YYYY 0hh:0mm:0ss” />`

The date string is processed with the following substitutions:

|!Token |!Substituted Value |
|`ddddd` |<<.from-version "5.2.0">> Day of year (1 to 365, or 366 for leap years) |
Expand Down