简体   繁体   中英

Formatting of the Dojo dijit/form/TimeTextBox dropdown

I have a TimeTextBox in Dojo - it currently looks like this:

在此处输入图片说明

However, I want it to look like this (with the hours emphasized - but with 10 minute increments instead of 15): 在此处输入图片说明

What's the simplest way to do this? Currently, I have these props set:

<input id="${ns}atdExamStartTime" type="text" name="examStartTime" data-dojo-type="dijit/form/TimeTextBox"
style="width:8em;" required="true"
data-dojo-props="promptMessage:'Enter the start time for the exam', 
    invalidMessage:'This is not a valid time',
    rangeMessage:'Exams must be scheduled between 8am and 10pm',
    constraints:{min:'T08:00',max:'T21:59',clickableIncrement:'T00:10:00',visibleIncrement:'T00:10:00'}" />    

Thanks in advance!

I know this answer is a bit late, but I hope it can help someone in some way. It looks like your code should work, to me at least. Here is a working JS Fiddle with 10 minute increments displayed like you want:

dijit.form.TimeTextBox({
    type:"text",
    name:"timePicker",
    constraints:{
        formatLength:"short",
        pickerMin:"T08:00:00",
        pickerMax:"T22:00:00",
        clickableIncrement:"T00:10:00"
    }
});

Try it here: http://jsfiddle.net/skyWB/104/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM