Web Component: j-Locale
j-Locale
This component sets current browser locale (number format, date format and time format) according to the navigatior.language
.
- jComponent
v19|v20
- singleton
path
will contain current's browser locale- sets
DEF.dateformat
and it creates environment value called[ts]
Configuration:
language
{String}
optional, a custom language (default:navigator.language
)requests
{Boolean}
optional, adds a language to the every request (it affectsDEF.languagehtml
, default:false
)
Environments:
[ts]
full timestamp[date]
only date[time]
only time
Output:
{
dt: 'yyyy–MM–dd', // date format
nf: 1, // number format: 1 = 100 000.123, 2 = 100 000,123, 3 = 100.000,123, 4 = 100,000.123
fdw: 0, // first day of week
tf: 24 // time format: 12, 24
}
Methods:
component.use(language)
Supported special languages:
eu
with the dd.MM.yyyy with a 24 hour systemus
with the MM-dd-yyyy with a 12 hour system
Author
- Peter Širka petersirka@gmail.com and Lucia Širková
- License
Created
13. april 2022
Updated
10. june 2024
jComponent library
19, 20
Version
v1
License
https://www.totaljs.com/license/
Responsive
Yes
Author
Peter Širka
Email
petersirka@gmail.com