1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| $('#headlineAddForm #rangeTime').daterangepicker({ showDropdowns : true, timePicker : true, timePicker24Hour: true, timePickerIncrement : 1, timePickerSeconds : true, linkedCalendars : false, locale : { format: "YYYY-MM-DD HH:mm:ss", separator : " - ", applyLabel : "确定", cancelLabel : "取消", fromLabel : "开始", toLabel: "结束", customRangeLabel : "自定义", weekLabel : "W", daysOfWeek : ["日", "一", "二", "三", "四", "五", "六"], monthNames : ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月 "], firstDay : 1 } }, function(start, end, label) { $("#headlineAddForm #startTime").val(start.unix()); $("#headlineAddForm #endTime").val(end.unix()); }).on('hide.daterangepicker', function() { $('#headlineAddForm').data('bootstrapValidator').updateStatus('rangeTime', 'NOT_VALIDATED',null).validateField('rangeTime'); }).on('cancel.daterangepicker', function() { $('#headlineAddForm #rangeTime').val(""); $('#headlineAddForm').data('bootstrapValidator').updateStatus('rangeTime', 'NOT_VALIDATED',null).validateField('rangeTime'); }).on('apply.daterangepicker', function() { if($.trim($("#headlineAddForm #startTime").val()).length == 0) { $('#headlineAddForm #rangeTime').val(""); $('#headlineAddForm').data('bootstrapValidator').updateStatus('rangeTime', 'NOT_VALIDATED',null).validateField('rangeTime'); } });
|