-
Notifications
You must be signed in to change notification settings - Fork 1k
Selecting the input box should not populate with date #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
yes, totally agree with that. The worst part of this bug is that if the user 'tabs' through a field with time picker but WITHOUT selecting a time, a default time will be included and user has to take the mouse to clear it... Actually, it's worse than that: if there already is a date in the field, it will be cleared to put the default date/time as soon as you activate the panel, even though you don't select anything! |
The idea here is to have a disabled text field so user sees the datetime (coming from Rails backend) but can only edit through the picker AND blank value is allowed. Datetimepicker (line 584-588): if (this.inst !== null) {
var timeDefined = this.timeDefined;
this._onTimeChange();
this.timeDefined = timeDefined;
} To keep a constant UI (Time pops once you select a time otherwise), add to your configuration: Lastly, to clear the field (since it's disabled), add this to your configuration: //HACK -> adding the clear button
beforeShow: function( input ) {
setTimeout(function() {
var buttonPane = $( input )
.datepicker( "widget" )
.find( ".ui-datepicker-buttonpane" );
$( "<button>", {
text: "Clear",
click: function() {
$(input).val('');
}
}).addClass('ui-state-default ui-corner-all')
.appendTo( buttonPane );
}, 1 );
} Hope it helps. I'm a bit shocked that nobody is handling this problem. Maybe I'm doing something wrong but I don't want the user to input ambiguous or incorrect dates... Any comments appreciated. |
Hey gamov, this use to not happen. At some point an update has changed the functionality... I will look back through the commits |
great, thanks. |
The initial click onto the input box should only popup the datepicker box where the user must make a selection to populate the input box. Currently, this is what happens:
On line 2, a default time should not be placed in the input box. Instead, the user must select a date/time. If the user closes the datepicker without doing so will render the input box empty.
There should be an additional parameter when creating the datetimepicker that prevents placing date/time onto the input box when the user selects the input box to see the datepicker.
thanks,
sgs.
The text was updated successfully, but these errors were encountered: