senters Posted December 27, 2011 Report Share Posted December 27, 2011 Izmantoju timepicker pluginu http://trentrichardson.com/examples/timepicker/. // Time Picker [JQUERY UI] $(function() { $('#timepicker').timepicker({ ampm: false, hourMin: 0, hourMax: 23, showSecond: false, timeFormat: 'hh:mm', stepHour: 1, stepMinute: 5, duration: 0 }) }); Lapā tas izskatas šādi - http://screencast.com/t/s1oMWPaLl. Vajadzīgs ir, lai nevar izvēlēties laiku, kas jau pagājis, bet rāda šī brīža laiku ar soli (stepMinute: 5). Ja tagad ir 9:58, tad sākuma atļautais datums, ko var izvēlēties ir 10:00. Datepicker'ī ir līdzīgi, lai nerādītu kalendārā pagājušos datumus - http://screencast.com/t/KwIbfUon8 tiek lietots parametrs "minDate: new Date()". Quote Link to comment Share on other sites More sharing options...
0 indoom Posted December 27, 2011 Report Share Posted December 27, 2011 izmanto datepickera onClose eventu (vai onSelect) , pārbaudi izvēlēto laiku un piekoriģē, lai nav pagātnē Quote Link to comment Share on other sites More sharing options...
0 senters Posted December 27, 2011 Author Report Share Posted December 27, 2011 noteikti domāji timepicker, jo datapicker un timepicker ir 2 dažādi plugini manā piemērā. vai vari parādīt kā esi domājis koda veidā? Quote Link to comment Share on other sites More sharing options...
0 daGrevis Posted December 27, 2011 Report Share Posted December 27, 2011 Demo no viņu lapas kurā tiek izmantots onSelect events: $('#example15').datetimepicker({ showSecond: true, showMillisec: true, timeFormat: 'hh:mm:ss:l', onSelect: function(dateText, inst){ if(window.console) console.log(dateText); } }); Quote Link to comment Share on other sites More sharing options...
0 indoom Posted December 27, 2011 Report Share Posted December 27, 2011 The timepicker addon adds a timepicker to jQuery UI Datepicker, http://jqueryui.com/demos/datepicker/ Quote Link to comment Share on other sites More sharing options...
Question
senters
Izmantoju timepicker pluginu http://trentrichardson.com/examples/timepicker/.
Lapā tas izskatas šādi - http://screencast.com/t/s1oMWPaLl.
Vajadzīgs ir, lai nevar izvēlēties laiku, kas jau pagājis, bet rāda šī brīža laiku ar soli (stepMinute: 5).
Ja tagad ir 9:58, tad sākuma atļautais datums, ko var izvēlēties ir 10:00.
Datepicker'ī ir līdzīgi, lai nerādītu kalendārā pagājušos datumus - http://screencast.com/t/KwIbfUon8 tiek lietots parametrs "minDate: new Date()".
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.