diff -Nur SemanticForms.backup/includes/SF_FormInputs.inc SemanticForms/includes/SF_FormInputs.inc
--- SemanticForms.backup/includes/SF_FormInputs.inc 2008-12-09 11:06:47.000000000 +0800
+++ SemanticForms/includes/SF_FormInputs.inc 2008-12-09 12:10:16.000000000 +0800
@@ -465,6 +465,7 @@
}
function dateEntryHTML($date, $input_name, $is_mandatory, $is_disabled, $other_args) {
+ global $wgAmericanDates;
global $sfgTabIndex, $sfgFieldNum, $sfgJSValidationCalls;
$input_id = "input_$sfgFieldNum";
@@ -496,15 +497,20 @@
$day = null; // no need for day
}
$disabled_text = ($is_disabled) ? "disabled" : "";
- $text = SFFormInputs::monthDropdownHTML($month, $input_name, $is_disabled);
- $text .= ' ' . "\n";
+ if ($wgAmericanDates == true) {
+ $text = SFFormInputs::monthDropdownHTML($month, $input_name, $is_disabled);
+ $text .= ' ' . "\n";
+ } else {
+ $text = ' ' . "\n";
+ $text .= SFFormInputs::monthDropdownHTML($month, $input_name, $is_disabled);
+ }
$text .= ' ' . "\n";
$text .= " ";
return array($text, null);
}
function dateTimeEntryHTML($datetime, $input_name, $is_mandatory, $is_disabled, $other_args) {
- global $sfgTabIndex;
+ global $sfgTabIndex, $wgAmericanDates;
$include_timezone = $other_args['include_timezone'];
@@ -515,14 +521,22 @@
if (isset($datetime['hour'])) $hour = $cur_value['hour'];
if (isset($datetime['minute'])) $minute = $cur_value['minute'];
if (isset($datetime['second'])) $second = $cur_value['second'];
- if (isset($datetime['ampm24h'])) $ampm24h = $cur_value['ampm24h'];
+ if ($wgAmericanDates == true) {
+ if (isset($datetime['ampm24h'])) $ampm24h = $cur_value['ampm24h'];
+ }
if (isset($datetime['timezone'])) $timezone = $cur_value['timezone'];
} else {
$actual_date = strtotime($datetime);
- $hour = date("g", $actual_date);
+ if ($wgAmericanDates == true) {
+ $hour = date("g", $actual_date);
+ } else {
+ $hour = date("G", $actual_date);
+ }
$minute = date("i", $actual_date);
$second = date("s", $actual_date);
- $ampm24h = date("A", $actual_date);
+ if ($wgAmericanDates == true) {
+ $ampm24h = date("A", $actual_date);
+ }
$timezone = date("T", $actual_date);
}
} else {
@@ -541,15 +555,17 @@
$sfgTabIndex++;
$text .= ':' . "\n";
- $sfgTabIndex++;
- $text .= '