Option cast_date
The cast_date option convert the CSV field to a JavaScript date. It requires the cast option to be active.
- Type:
boolean - Optional
- Default:
false - Since: 1.0.5
- Related:
cast,info,on_record— see Available Options
The implementation relies on Date.parse. The CSV value is left untouched if the function returns NaN.
History
This option was named auto_parse_date until version 2.
Usage
When active cast_date with true, every field is tested with Date.parse. When the convertion to a JavaScript date succeed, the new date is returned. Otherwise, the original value is returned.