File tree 2 files changed +12
-14
lines changed
2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -365,8 +365,10 @@ <h2>Formatting Your Time</h2>
365
365
< p > The default format is "hh:mm tt", however ampm is turned off by default, so you will see "hh:mm"</ p >
366
366
367
367
< dl class ="defs ">
368
- < dt > h</ dt > < dd > Hour with no leading 0</ dd >
369
- < dt > hh</ dt > < dd > Hour with leading 0</ dd >
368
+ < dt > H</ dt > < dd > Hour with no leading 0 (24 hour)</ dd >
369
+ < dt > HH</ dt > < dd > Hour with leading 0 (24 hour)</ dd >
370
+ < dt > h</ dt > < dd > Hour with no leading 0 (12 hour)</ dd >
371
+ < dt > hh</ dt > < dd > Hour with leading 0 (12 hour)</ dd >
370
372
< dt > m</ dt > < dd > Minute with no leading 0</ dd >
371
373
< dt > mm</ dt > < dd > Minute with leading 0</ dd >
372
374
< dt > s</ dt > < dd > Second with no leading 0</ dd >
@@ -507,8 +509,8 @@ <h3 id="basic_examples">Basic Initializations</h3>
507
509
< pre >
508
510
$('#basic_example_3').datetimepicker({
509
511
timeFormat: "h:m t",
510
- pickerTimeFormat: "HH:mm",
511
- ampm: true
512
+ pickerTimeFormat: "HH:mm"// ,
513
+ // ampm: true
512
514
});
513
515
</ pre >
514
516
</ div >
Original file line number Diff line number Diff line change 1150
1150
hour = 12 ;
1151
1151
}
1152
1152
1153
- var result ;
1154
1153
if ( hour < 10 ) {
1155
- result = "0" + hour ;
1156
- }
1157
- else {
1158
- result = String ( hour ) ;
1154
+ hour = "0" + hour ;
1159
1155
}
1160
1156
1161
- return result ;
1157
+ return String ( hour ) ;
1162
1158
} ;
1163
1159
1164
1160
/*
1181
1177
var tmptime = format ,
1182
1178
ampmName = options . amNames [ 0 ] ,
1183
1179
hour = parseInt ( time . hour , 10 ) ;
1184
- if ( options . ampm ) {
1185
- if ( hour > 11 ) {
1186
- ampmName = options . pmNames [ 0 ] ;
1187
- }
1180
+
1181
+ if ( hour > 11 ) {
1182
+ ampmName = options . pmNames [ 0 ] ;
1188
1183
}
1184
+
1189
1185
tmptime = tmptime . replace ( / (?: H H ? | h h ? | m m ? | s s ? | [ t T ] { 1 , 2 } | [ l z ] | ( ' .* ?' | " .* ?" ) ) / g, function ( match ) {
1190
1186
switch ( match ) {
1191
1187
case 'HH' :
You can’t perform that action at this time.
0 commit comments