For how to display data in the drop-down list for half an hour, I first set a & lt; select & gt; control to display data between AM and am, that is ...... And so on. use JS to achieve better if you can use the my97 control ------ solution --------------- How to make the drop-down list display data for half an hour
Set The widget displays data between AM and am, that is, am, AM, am ...... And so on. use JS to achieve better performance if you can use the my97 control.
------ Solution --------------------
Sometimes it is simple and the most effective method
Let me write something dynamic for you.
Script
// SelObj select object
// Begin start time
// Edn end time
// Step size
Function fn (selObj, begin, end, step ){
Function mm (str ){
Var re = 0;
Str. replace (/(\ d +) :( \ d +)/, function (_, h, m) {re = h * 60 + m * 1 });
Return re;
}
Function fmt (v) {return (v + 100 + ''). slice (1 )}
Var bv = mm (begin), ev = mm (end );
Console.info (bv, ev)
For (I = bv; I <= ev; I + = step ){
Console.info (fmt (I/60> 0) + ':' + fmt (I % 60 ))
Var text = fmt (I/60> 0) + ':' + fmt (I % 60 );
SelObj. options. add (new Option (text, text ))
}
}
Fn (document. getElementById ("sel1"), '1: 00', '2: 30', 30)
Script