@@ -33,6 +33,7 @@ function Timepicker() {
33
33
closeText : 'Done' ,
34
34
ampm : false ,
35
35
timeFormat : 'hh:mm tt' ,
36
+ timeSuffix : '' ,
36
37
timeOnlyTitle : 'Choose Time' ,
37
38
timeText : 'Time' ,
38
39
hourText : 'Hour' ,
@@ -198,7 +199,7 @@ $.extend(Timepicker.prototype, {
198
199
. replace ( / s { 1 , 2 } / ig, '(\\d?\\d)' )
199
200
. replace ( / t { 1 , 2 } / ig, '(am|pm|a|p)?' )
200
201
. replace ( / z { 1 } / ig, '((\\+|-)\\d\\d\\d\\d)?' )
201
- . replace ( / \s / g, '\\s?' ) + '$' ,
202
+ . replace ( / \s / g, '\\s?' ) + this . _defaults . timeSuffix + '$' ,
202
203
order = this . _getFormatPositions ( ) ,
203
204
treg ;
204
205
@@ -624,7 +625,7 @@ $.extend(Timepicker.prototype, {
624
625
if ( this . _defaults . ampm ) this . ampm = ampm ;
625
626
626
627
this . _formatTime ( ) ;
627
- if ( this . $timeObj ) this . $timeObj . text ( this . formattedTime ) ;
628
+ if ( this . $timeObj ) this . $timeObj . text ( this . formattedTime + this . _defaults . timeSuffix ) ;
628
629
this . timeDefined = true ;
629
630
if ( hasChanged ) this . _updateDateTime ( ) ;
630
631
} ,
@@ -699,7 +700,7 @@ $.extend(Timepicker.prototype, {
699
700
if ( this . _defaults . timeOnly === true ) {
700
701
formattedDateTime = this . formattedTime ;
701
702
} else if ( this . _defaults . timeOnly !== true && ( this . _defaults . alwaysSetTime || timeAvailable ) ) {
702
- formattedDateTime += this . _defaults . separator + this . formattedTime ;
703
+ formattedDateTime += this . _defaults . separator + this . formattedTime + this . _defaults . timeSuffix ;
703
704
}
704
705
705
706
this . formattedDateTime = formattedDateTime ;
@@ -774,7 +775,7 @@ $.datepicker._selectDate = function (id, dateStr) {
774
775
tp_inst . _limitMinMaxDateTime ( inst , true ) ;
775
776
inst . inline = inst . stay_open = true ;
776
777
//This way the onSelect handler called from calendarpicker get the full dateTime
777
- this . _base_selectDate ( id , dateStr + tp_inst . _defaults . separator + tp_inst . formattedTime ) ;
778
+ this . _base_selectDate ( id , dateStr + tp_inst . _defaults . separator + tp_inst . formattedTime + tp_inst . _defaults . timeSuffix ) ;
778
779
inst . inline = inst . stay_open = false ;
779
780
this . _notifyChange ( inst ) ;
780
781
this . _updateDatepicker ( inst ) ;
@@ -819,6 +820,7 @@ $.datepicker._doKeyPress = function(event) {
819
820
. replace ( / t / g, ampm ? 'ap' : '' ) +
820
821
" " +
821
822
tp_inst . _defaults . separator +
823
+ tp_inst . _defaults . timeSuffix +
822
824
$ . datepicker . _possibleChars ( $ . datepicker . _get ( inst , 'dateFormat' ) ) ,
823
825
chr = String . fromCharCode ( event . charCode === undefined ? event . keyCode : event . charCode ) ;
824
826
return event . ctrlKey || ( chr < ' ' || ! datetimeChars || datetimeChars . indexOf ( chr ) > - 1 ) ;
0 commit comments