2

您好,我使用 timepicker.js 创建了一个带有小时和分钟滑块选择的日历。一切正常,但是当我保存数据时,假设我选择了 14-10-2012 12:33PM,当我在输入字段中调用该值时它会显示它,但是当我单击输入以显示时间选择器时对话框中,时间和滑块始终为零。我可以自己编码以显示正确的时间,但我相信时间选择器中应该有一个选项可以做到这一点。

 ![function Timepicker() {
        this.regional = \[\]; // Available regional settings, indexed by language code
        this.regional\[''\] = { // Default regional settings
            currentText: 'Now',
            closeText: 'Done',
            ampm: false,
            amNames: \['AM', 'A'\],
            pmNames: \['PM', 'P'\],
            timeFormat: 'hh:mm tt',
            timeSuffix: '',
            timeOnlyTitle: 'Choose Time',
            timeText: 'Time',
            hourText: 'Hour',
            minuteText: 'Minute',
            secondText: 'Second',
            millisecText: 'Millisecond',
            timezoneText: 'Time Zone'
        };
        this._defaults = { // Global defaults for all the datetime picker instances
            showButtonPanel: true,
            timeOnly: false,
            showHour: true,
            showMinute: true,
            showSecond: false,
            showMillisec: false,
            showTimezone: false,
            showTime: true,
            stepHour: 1,
            stepMinute: 1,
            stepSecond: 1,
            stepMillisec: 1,
            hour: 0,
            minute: 0,
            second: 0,
            millisec: 0,
            timezone: '+0000',
            hourMin: 0,
            minuteMin: 0,
            secondMin: 0,
            millisecMin: 0,
            hourMax: 23,
            minuteMax: 59,
            secondMax: 59,
            millisecMax: 999,
            minDateTime: null,
            maxDateTime: null,
            onSelect: null,
            hourGrid: 0,
            minuteGrid: 0,
            secondGrid: 0,
            millisecGrid: 0,
            alwaysSetTime: true,
            separator: ' ',
            altFieldTimeOnly: true,
            showTimepicker: true,
            timezoneIso8609: false,
            timezoneList: null,
            addSliderAccess: false,
            sliderAccessArgs: null
        };][1]
4

1 回答 1

0

要在时间范围内仅使用时间,请使用 $.timepicker.timeRange():

var startTimeTextBox = $('#range_example_3_start');
var endTimeTextBox = $('#range_example_3_end');

$.timepicker.timeRange(
    startTimeTextBox,
    endTimeTextBox,
    {
        minInterval: (1000*60*60), // 1hr
        timeFormat: 'HH:mm',
        start: {}, // start picker options
        end: {} // end picker options
    }
);
于 2015-05-14T12:23:51.980 回答