parse_date

将日期字符串转换为 Date 对象

datestring需要转换的字符串

Example

var cfg = scheduler.config;
var strToDate = scheduler.date.str_to_date(cfg.date_format, cfg.server_utc);
 
scheduler.templates.parse_date = function(date){
    return strToDate(date);
};

Details

当解析事件的 start_date/end_date 属性且它们以字符串形式传入时,该函数由 scheduler.load()scheduler.parse() 触发。
如果您的日期格式不同且默认解析器无法正常工作,可以重写此函数。详情请参见 日期格式规范

了解更多关于 Date 对象

See also
返回顶部