Skip to content

Commit 176a64b

Browse files
committed
[dev] cleanup date_format.md config
1 parent 7f34dcb commit 176a64b

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

docs/api/config/date_format.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,9 @@ If you want to use a custom format, you can either change this config, or redefi
3030

3131
## Loading dates in ISO format
3232

33-
Since v9.1.3, Gantt automatically detects and parses ISO 8601 date strings. The `date_format` config is not needed for ISO strings - they are recognized and parsed directly.
33+
Since v9.1.3, Gantt automatically detects and parses ISO 8601 date strings. The `date_format` config is not needed for ISO strings - they are recognized and parsed directly.
3434

35-
Supported ISO 8601 patterns:
36-
37-
- `2026-01-06` - date only
38-
- `2026-01-06T10:30:45` - date and time
39-
- `2026-01-06T10:30:45.123` - date and time with milliseconds
40-
- `2026-01-06T10:30:45.000Z` - UTC
41-
- `2026-01-06T10:30:45+02:00` - with timezone offset
35+
When ISO dates are detected on input, they are serialized back as ISO strings automatically when passed to the [DataProcessor](guides/server-side.md). Date-only strings (e.g., `"2026-01-06"`) are serialized back as date-only strings, preserving the original format.
4236

4337
The `date_format` config still applies to non-ISO date strings.
4438

@@ -63,8 +57,8 @@ For more details, see [Loading dates in ISO format](guides/loading.md#loading-da
6357
If you need to change the date format dynamically, it is necessary to modify the [parse_date](api/template/parse_date.md) template in the following way:
6458

6559
~~~js
66-
var cfg = gantt.config;
67-
var strToDate = gantt.date.str_to_date(cfg.date_format, cfg.server_utc);
60+
const cfg = gantt.config;
61+
const strToDate = gantt.date.str_to_date(cfg.date_format, cfg.server_utc);
6862

6963
gantt.templates.parse_date = function(date){
7064
return strToDate (date);

0 commit comments

Comments
 (0)