Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc |
— | — | @@ -670,7 +670,7 @@ |
671 | 671 | $year = date("Y", $cur_time); |
672 | 672 | $month = date("n", $cur_time); |
673 | 673 | $day = date("j", $cur_time); |
674 | | - global $wgAmericanDates; |
| 674 | + global $wgAmericanDates, $sfg24HourTime; |
675 | 675 | if ($wgAmericanDates == true) { |
676 | 676 | $month_names = sffGetMonthNames(); |
677 | 677 | $month_name = $month_names[$month - 1]; |
— | — | @@ -679,11 +679,19 @@ |
680 | 680 | $cur_value_in_template = "$year/$month/$day"; |
681 | 681 | } |
682 | 682 | if ($input_type == 'datetime' || $input_type == 'datetime with timezone') { |
683 | | - $hour = str_pad(intval(substr(date("g", $cur_time),0,2)),2,'0',STR_PAD_LEFT); |
| 683 | + if ($sfg24HourTime) { |
| 684 | + $hour = str_pad(intval(substr(date("G", $cur_time),0,2)),2,'0',STR_PAD_LEFT); |
| 685 | + } else { |
| 686 | + $hour = str_pad(intval(substr(date("g", $cur_time),0,2)),2,'0',STR_PAD_LEFT); |
| 687 | + } |
684 | 688 | $minute = str_pad(intval(substr(date("i", $cur_time),0,2)),2,'0',STR_PAD_LEFT); |
685 | 689 | $second = str_pad(intval(substr(date("s", $cur_time),0,2)),2,'0',STR_PAD_LEFT); |
686 | | - $ampm = date("A", $cur_time); |
687 | | - $cur_value_in_template .= " $hour:$minute:$second $ampm"; |
| 690 | + if ($sfg24HourTime) { |
| 691 | + $cur_value_in_template .= " $hour:$minute:$second"; |
| 692 | + } else { |
| 693 | + $ampm = date("A", $cur_time); |
| 694 | + $cur_value_in_template .= " $hour:$minute:$second $ampm"; |
| 695 | + } |
688 | 696 | } |
689 | 697 | if ($input_type == 'datetime with timezone') { |
690 | 698 | $timezone = date("T", $cur_time); |