Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
115
rated 0 times [  118] [ 3]  / answers: 1 / hits: 49538  / 15 Years ago, sun, august 9, 2009, 12:00:00

Hi fellow stackoverflow:ers,



I'm using the jQuery Datepicker plugin, together with Martin Milesich Timepicker plugin. Everything works great, except for the fact that clicking a date in the datepicker, closes the widget, leaving no time to pick the time.



Question: So I'm wondering if there's a way to prevent the widget from closing when clicking a date, and instead force users to click the Done button (that shows up when enabling the showButtonPanel: true option), or clicking outside of the widget. I don't want my users having to open the widget twice! See the behavior online at the timepicker demo



Any help solving this issue, or even pointers in the right direction, is appreciated!



More info:
I'm using the files supplied from Martins download link: http://milesich.com/tpdemo/timepicker-0.2.0.zip




  • jquery-ui-1.7.2.custom.min.js

  • timepicker.js (latest version 0.2.0)



These are the options I'm using:



$(document).ready(function(){
$(.datepicker).datepicker({
duration: '',
showTime: true,
constrainInput: false,
stepMinutes: 5,
stepHours: 1,
time24h: true,
dateFormat: yy-mm-dd,
buttonImage: '/static/images/datepicker.png',
buttonImageOnly: true,
firstDay: 1,
monthNames: ['Januari','Februari','Mars','April','Maj','Juni','Juli','Augusti','September','Oktober','November','December'],
showOn: 'both',
showButtonPanel: true
});
})

More From » jquery

 Answers
15

rather than changing the source it's best to use the existing events



onSelect: function() {
$(this).data('datepicker').inline = true;
},
onClose: function() {
$(this).data('datepicker').inline = false;
}

[#98948] Thursday, August 6, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
susanajamiep

Total Points: 466
Total Questions: 113
Total Answers: 108

Location: Liberia
Member since Fri, Oct 22, 2021
3 Years ago
susanajamiep questions
Sun, Jun 12, 22, 00:00, 2 Years ago
Mon, Mar 7, 22, 00:00, 2 Years ago
Wed, Jun 10, 20, 00:00, 4 Years ago
Fri, Jan 24, 20, 00:00, 4 Years ago
;