Time
Intro
Inspired by shoelace but usable on regular
time
elements with a datetime
attribute.
The datetime
attribute is observed and changing it will render the tag again.
Demos
lang
is supported.
Date time in german :
Date time in german (long date, short time) :
Date time in german (long date, short time using config) :
Use default locale if not specified. Specify formats using data-year
, data-month
or
data-style
Date in current locale :
Date (y) in current locale :
Date (Y-m) in current locale :
Date in german :
Date in german :
Use 24h format with data-hour12="false"
Time in current locale :
Time in current locale 24h :
Time in current locale 24h with incompatible option:
Time in german :
Time in german :
Use data-relative
for relative time.
Relative time:
Relative time in german:
If a value is provided (eg: server side value) nothing will happen unless data-render
is used
Server time:
Server time: