Skip to content

Commit 8a259c8

Browse files
authored
Merge pull request #12 from DHTMLX/next
[update] localization updated with date and time format specififcation
2 parents 16b1ea5 + 019d20f commit 8a259c8

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

docs/guides/localization.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,40 @@ function changeFormat() {
428428
~~~
429429

430430
:::info
431-
You can also see the example in the [snippet tool](https://snippet.dhtmlx.com/rxjnw54x)
431+
You can also see an example in the [snippet tool](https://snippet.dhtmlx.com/rxjnw54x)
432432
:::
433433

434+
## Date and time format specification
435+
436+
Booking uses the following characters for setting the date and time format:
437+
438+
| Character | Definition |Example |
439+
| :-------- | :------------------------------------------------ |:------------------------|
440+
| %d | day as a number with leading zero | from 01 to 31 |
441+
| %j | day as a number | from 1 to 31 |
442+
| %D | short name of the day (abbreviation) | Su Mo Tu Sat |
443+
| %l | full name of the day | Sunday Monday Tuesday |
444+
| %W | week as a number with leading zero (with Monday as the first day of the week) | from 01 to 52/53 |
445+
| %m | month as a number with leading zero | from 01 to 12 |
446+
| %n | month as a number | from 1 to 12 |
447+
| %M | short name of the month | Jan Feb Mar |
448+
| %F | full name of the month | January February March |
449+
| %y | year as a number, 2 digits | 24 |
450+
| %Y | year as a number, 4 digits | 2024 |
451+
| %h | hours 12-format with leading zero | from 01 to 12 |
452+
| %g | hours 12-format | from 1 to 12 |
453+
| %H | hours 24-format with leading zero | from 00 to 23 |
454+
| %G | hours 24-format | from 0 to 23 |
455+
| %i | minutes with leading zero | from 01 to 59 |
456+
| %s | seconds with leading zero | from 01 to 59 |
457+
| %S | milliseconds | 128 |
458+
| %a | am or pm | am (for time from midnight until noon) and pm (for time from noon until midnight)|
459+
| %A | AM or PM | AM (for time from midnight until noon) and PM (for time from noon until midnight)|
460+
| %c | displays date and time in the ISO 8601 date format| 2024-10-04T05:04:09 |
461+
462+
463+
To present the 20th of June, 2024 with the exact time as *2024-09-20 16:47:08.128*, specify "%Y-%m-%d-%H:%i:%s.%u".
464+
434465
## Example
435466

436467
In this snippet you can see how to switch between the *EN* and *DE* locales:

0 commit comments

Comments
 (0)