@@ -65,7 +65,8 @@ function Timepicker() {
65
65
hourGrid : 0 ,
66
66
minuteGrid : 0 ,
67
67
secondGrid : 0 ,
68
- alwaysSetTime : true
68
+ alwaysSetTime : true ,
69
+ separator : ' '
69
70
} ;
70
71
$ . extend ( this . _defaults , this . regional [ '' ] ) ;
71
72
}
@@ -169,7 +170,7 @@ $.extend(Timepicker.prototype, {
169
170
// parse the time string from input value or _setTime
170
171
//########################################################################
171
172
_parseTime : function ( timeString , withDate ) {
172
- var regstr = this . _defaults . timeFormat . toString ( )
173
+ var regstr = this . _defaults . separator + this . _defaults . timeFormat . toString ( )
173
174
. replace ( / h { 1 , 2 } / ig, '(\\d?\\d)' )
174
175
. replace ( / m { 1 , 2 } / ig, '(\\d?\\d)' )
175
176
. replace ( / s { 1 , 2 } / ig, '(\\d?\\d)' )
@@ -184,7 +185,7 @@ $.extend(Timepicker.prototype, {
184
185
// the time should come after x number of characters and a space.
185
186
// x = at least the length of text specified by the date format
186
187
var dp_dateFormat = $ . datepicker . _get ( this . inst , 'dateFormat' ) ;
187
- regstr = '.{' + dp_dateFormat . length + ',}\\s+ ' + regstr ;
188
+ regstr = '.{' + dp_dateFormat . length + ',}\\s*? ' + regstr ;
188
189
}
189
190
190
191
treg = timeString . match ( new RegExp ( regstr , 'i' ) ) ;
@@ -597,6 +598,7 @@ $.extend(Timepicker.prototype, {
597
598
if ( dp_inst . lastVal !== undefined && ( dp_inst . lastVal . length > 0 && this . $input . val ( ) . length === 0 ) )
598
599
return ;
599
600
601
+ < << << << HEAD
600
602
if ( this . _defaults . timeOnly === true ) {
601
603
formattedDateTime = this . formattedTime ;
602
604
if ( this . $altInput ) {
@@ -611,6 +613,12 @@ $.extend(Timepicker.prototype, {
611
613
}
612
614
}
613
615
formattedDateTime += ' ' + this . formattedTime ;
616
+ = === ===
617
+ if ( this . _defaults . timeOnly === true ) formattedDateTime = this . formattedTime ;
618
+ else if ( this . _defaults . timeOnly !== true && ( this . _defaults . alwaysSetTime || timeAvailable ) ) {
619
+ if ( this . $altInput ) this . $altInput . val ( this . formattedTime ) ;
620
+ else formattedDateTime += this . _defaults . separator + this . formattedTime ;
621
+ > >>> >>> michael - simons - master
614
622
}
615
623
616
624
this . formattedDateTime = formattedDateTime ;
0 commit comments