@@ -64,7 +64,8 @@ function Timepicker() {
64
64
minuteGrid : 0 ,
65
65
secondGrid : 0 ,
66
66
alwaysSetTime : true ,
67
- separator : ' '
67
+ separator : ' ' ,
68
+ altFieldTimeOnly : true
68
69
} ;
69
70
$ . extend ( this . _defaults , this . regional [ '' ] ) ;
70
71
}
@@ -155,7 +156,7 @@ $.extend(Timepicker.prototype, {
155
156
// add our sliders to the calendar
156
157
//########################################################################
157
158
_addTimePicker : function ( dp_inst ) {
158
- var currDT = ( this . $altInput ) ?
159
+ var currDT = ( this . $altInput && this . _defaults . altFieldTimeOnly ) ?
159
160
this . $input . val ( ) + ' ' + this . $altInput . val ( ) :
160
161
this . $input . val ( ) ;
161
162
@@ -598,22 +599,24 @@ $.extend(Timepicker.prototype, {
598
599
599
600
if ( this . _defaults . timeOnly === true ) {
600
601
formattedDateTime = this . formattedTime ;
601
- if ( this . $altInput ) {
602
- this . $altInput . val ( this . formattedDateTime ) ;
603
- }
604
- } else if ( this . _defaults . timeOnly !== true && ( this . _defaults . alwaysSetTime || timeAvailable ) ) {
605
- if ( this . $altInput ) {
606
- if ( this . _defaults . timeOnly !== true ) {
607
- this . $altInput . val ( this . $altInput . val ( ) + this . _defaults . separator + this . formattedTime ) ;
608
- } else {
609
- this . $altInput . val ( this . formattedDateTime ) ;
610
- }
611
- }
602
+ } else if ( this . _defaults . timeOnly !== true && ( this . _defaults . alwaysSetTime || timeAvailable ) ) {
612
603
formattedDateTime += this . _defaults . separator + this . formattedTime ;
613
604
}
614
605
615
606
this . formattedDateTime = formattedDateTime ;
616
- this . $input . val ( formattedDateTime ) . trigger ( "change" ) ;
607
+
608
+ if ( this . $altInput && this . _defaults . altFieldTimeOnly === true ) {
609
+ this . $altInput . val ( this . formattedTime ) ;
610
+ this . $input . val ( this . formattedDate ) ;
611
+ } else if ( this . $altInput ) {
612
+ this . $altInput . val ( formattedDateTime ) ;
613
+ this . $input . val ( formattedDateTime ) ;
614
+ }
615
+ else {
616
+ this . $input . val ( formattedDateTime ) ;
617
+ }
618
+
619
+ this . $input . trigger ( "change" ) ;
617
620
}
618
621
619
622
} ) ;
0 commit comments