Jquery mobile 如何设置日期框的时间范围

Jquery mobile 如何设置日期框的时间范围,jquery-mobile,datebox,Jquery Mobile,Datebox,我正在尝试设置时间范围(例如,仅从上午9点到下午3点)。到目前为止,我只能设置默认时间 $('#time').trigger('datebox', {"method":"set", "value":"06:00 PM"}); 抱歉,它不受支持。看起来只有几天和几年支持最小值和最大值。如果你支持他的回购协议,这可能不难添加到代码中 通过查看github上的源代码,您可以查看所有选项,有文档的和无文档的 事实上,DateBox1不支持它,但是DateBox2支持它:(目前这个版本需要jquery

我正在尝试设置时间范围(例如,仅从上午9点到下午3点)。到目前为止,我只能设置默认时间

$('#time').trigger('datebox', {"method":"set", "value":"06:00 PM"});

抱歉,它不受支持。看起来只有几天和几年支持最小值和最大值。如果你支持他的回购协议,这可能不难添加到代码中

通过查看github上的源代码,您可以查看所有选项,有文档的和无文档的


事实上,DateBox1不支持它,但是DateBox2支持它:(目前这个版本需要jquery 1.7.1+)(它仍然是相当的beta版,但相当可靠)

options: {
    // All widget options, including some internal runtime details
    version: '1.0.1-2012022700', // jQMMajor.jQMMinor.DBoxMinor-YrMoDaySerial
    theme: false,
    defaultTheme: 'c',
    pickPageTheme: 'b',
    pickPageInputTheme: 'e',
    pickPageButtonTheme: 'a',
    pickPageHighButtonTheme: 'e',
    pickPageOHighButtonTheme: 'e',
    pickPageOAHighButtonTheme: 'e',
    pickPageODHighButtonTheme: 'e',
    pickPageTodayButtonTheme: 'e',
    pickPageSlideButtonTheme: 'd',
    pickPageFlipButtonTheme: 'b',
    forceInheritTheme: false,
    centerWindow: false,
    calHighToday: true,
    calHighPicked: true,
    transition: 'pop',
    noAnimation: false,
    disableManualInput: false,

    disabled: false,
    wheelExists: false,
    swipeEnabled: true,
    zindex: '500',
    debug: false,
    clickEvent: 'vclick',
    numberInputEnhance: true,
    internalInputType: 'text',
    resizeListener: true,

    titleDialogLabel: false,
    meridiemLetters: ['AM', 'PM'],
    timeOutputOverride: false,
    timeFormats: { '12': '%l:%M %p', '24': '%k:%M' },
    durationFormat: 'DD ddd, hh:ii:ss',
    timeOutput: false,
    rolloverMode: { 'm': true, 'd': true, 'h': true, 'i': true, 's': true },

    mode: 'datebox',
    calShowDays: true,
    calShowOnlyMonth: false,
    useDialogForceTrue: false,
    useDialogForceFalse: true,
    fullScreen: false,
    fullScreenAlways: false,
    useDialog: false,
    useModal: false,
    useInline: false,
    useInlineBlind: false,
    useClearButton: false,
    collapseButtons: false,
    noButtonFocusMode: false,
    focusMode: false,
    noButton: false,
    noSetButton: false,
    openCallback: false,
    openCallbackArgs: [],
    closeCallback: false,
    closeCallbackArgs: [],
    open: false,
    nestedBox: false,
    lastDuration: false,

    fieldsOrder: false,
    fieldsOrderOverride: false,
    durationOrder: ['d', 'h', 'i', 's'],
    defaultDateFormat: '%Y-%m-%d',
    dateFormat: false,
    timeFormatOverride: false,
    headerFormat: false,
    dateOutput: false,
    minuteStep: 1,
    calTodayButton: false,
    calWeekMode: false,
    calWeekModeFirstDay: 1,
    calWeekModeHighlight: true,
    calStartDay: false,
    defaultPickerValue: false,
    defaultDate : false,    //this is deprecated and will be removed in the future versions (ok, may be not)
    minYear: false,
    maxYear: false,
    afterToday: false,
    beforeToday: false,
    maxDays: false,
    minDays: false,
    highDays: false,
    highDates: false,
    highDatesAlt: false,
    blackDays: false,
    blackDates: false,
    enableDates: false,
    fixDateArrays: false,
    durationSteppers: {'d': 1, 'h': 1, 'i': 1, 's': 1},
    useLang: 'en',
    lang: {
        'en' : {
            setDateButtonLabel: 'Set Date',
            setTimeButtonLabel: 'Set Time',
            setDurationButtonLabel: 'Set Duration',
            calTodayButtonLabel: 'Jump to Today',
            titleDateDialogLabel: 'Set Date',
            titleTimeDialogLabel: 'Set Time',
            daysOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
            daysOfWeekShort: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
            monthsOfYear: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
            monthsOfYearShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            durationLabel: ['Days', 'Hours', 'Minutes', 'Seconds'],
            durationDays: ['Day', 'Days'],
            timeFormat: 24,
            headerFormat: '%A, %B %-d, %Y',
            tooltip: 'Open Date Picker',
            nextMonth: 'Next Month',
            prevMonth: 'Previous Month',
            dateFieldOrder: ['m', 'd', 'y'],
            timeFieldOrder: ['h', 'i', 'a'],
            slideFieldOrder: ['y', 'm', 'd'],
            dateFormat: '%Y-%m-%d',
            useArabicIndic: false,
            isRTL: false,
            calStartDay: 0,
            clearButton: 'Clear'
        }
    }
}