[freeside-commits] freeside/httemplate/elements tr-input-date-field.html, 1.8, 1.8.2.1 tr-input-beginning_ending.html, 1.7, 1.7.4.1
Ivan,,,
ivan at wavetail.420.am
Mon Mar 8 02:57:19 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv29007/httemplate/elements
Modified Files:
Tag: FREESIDE_1_9_BRANCH
tr-input-date-field.html tr-input-beginning_ending.html
Log Message:
proper use of date_format config for international date formats, RT#7009
Index: tr-input-beginning_ending.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-input-beginning_ending.html,v
retrieving revision 1.7
retrieving revision 1.7.4.1
diff -u -w -d -r1.7 -r1.7.4.1
--- tr-input-beginning_ending.html 5 Oct 2007 19:45:03 -0000 1.7
+++ tr-input-beginning_ending.html 8 Mar 2010 10:57:17 -0000 1.7.4.1
@@ -11,7 +11,7 @@
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $opt{prefix} %>beginning_text",
- ifFormat: "%m/%d/%Y<% $time_format %>",
+ ifFormat: "<% $date_format. $time_format %>",
button: "<% $opt{prefix} %>beginning_button",
align: "BR"
<% $input_time %>
@@ -30,7 +30,7 @@
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $opt{prefix} %>ending_text",
- ifFormat: "%m/%d/%Y<% $time_format %>",
+ ifFormat: "<% $date_format. $time_format %>",
button: "<% $opt{prefix} %>ending_button",
align: "BR"
<% $input_time %>
@@ -54,6 +54,10 @@
my %opt = @_;
+my $conf = new FS::Conf;
+
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
$opt{prefix} = '' unless defined $opt{prefix};
$opt{prefix} .= '_' if $opt{prefix};
Index: tr-input-date-field.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-input-date-field.html,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -w -d -r1.8 -r1.8.2.1
--- tr-input-date-field.html 7 Aug 2009 23:08:03 -0000 1.8
+++ tr-input-date-field.html 8 Mar 2010 10:57:17 -0000 1.8.2.1
@@ -21,8 +21,8 @@
});
</SCRIPT>
-
<%init>
+
my($name, $value, $label, $format, $usedatetime);
if ( ref($_[0]) ) {
my $opt = shift;
@@ -35,7 +35,10 @@
($name, $value, $label, $format, $usedatetime) = @_;
}
-$format = "%m/%d/%Y" unless $format;
+my $conf = new FS::Conf;
+
+$format ||= $conf->config('date_format') || '%m/%d/%Y';
+
$label = $name unless $label;
if ( $value =~ /\S/ ) {
More information about the freeside-commits
mailing list