i18n the datepicker. fixes bug #10976.
This commit is contained in:
parent
8395d090fa
commit
bb10f0e3d0
7 changed files with 489 additions and 143 deletions
|
|
@ -47,6 +47,7 @@
|
|||
- fixed #10901: Calendar More Button/Display Box IE8 error.
|
||||
- fixed #10954: DataForm fails silently
|
||||
- fixed #10950: Thingy
|
||||
- fixed #10976: Form::Date not internationalized /DateTime::setToEpoch
|
||||
|
||||
7.7.19
|
||||
- fixed #10838: Forwarded forum post email to new CS adds reply to original thread
|
||||
|
|
|
|||
|
|
@ -209,44 +209,48 @@ Renders a date picker control.
|
|||
=cut
|
||||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $value;
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $value;
|
||||
# This should probably be rewritten as a cascading ternary
|
||||
if ($self->get("_defaulted") && $self->get("noDate") ) {
|
||||
# No default date
|
||||
$value = $self->set("value",'');
|
||||
}
|
||||
# No default date
|
||||
$value = $self->set("value",'');
|
||||
}
|
||||
elsif (!$self->get("defaultValue")
|
||||
|| $self->get("defaultValue") =~ m/^\d+$/
|
||||
|| !$self->get("value")
|
||||
|| $self->get("value") =~ m/^\d+$/) {
|
||||
# Epoch format
|
||||
$value = $self->session->datetime->epochToSet($self->getOriginalValue);
|
||||
}
|
||||
# Epoch format
|
||||
$value = $session->datetime->epochToSet($self->getOriginalValue);
|
||||
}
|
||||
else {
|
||||
# MySQL format
|
||||
$value = $self->getOriginalValue;
|
||||
# NOTE: Cannot fix time zone since we don't have a complete date/time
|
||||
}
|
||||
# MySQL format
|
||||
$value = $self->getOriginalValue;
|
||||
# NOTE: Cannot fix time zone since we don't have a complete date/time
|
||||
}
|
||||
|
||||
$self->session->style->setLink($self->session->url->extras('yui/build/calendar/assets/skins/sam/calendar.css'), { rel=>"stylesheet", type=>"text/css", media=>"all" });
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/yahoo/yahoo-min.js'),{ type=>'text/javascript' });
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/dom/dom-min.js'),{ type=>'text/javascript' });
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/event/event-min.js'),{ type=>'text/javascript' });
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/calendar/calendar-min.js'),{ type=>'text/javascript' });
|
||||
#my $firstDow = $self->session->user->profileField("firstDayOfWeek");
|
||||
#$self->session->style->setRawHeadTags("<script type=\"text/javascript\">var webguiFirstDayOfWeek = $firstDow</script>");
|
||||
$self->session->style->setScript($self->session->url->extras('yui-webgui/build/datepicker/datepicker.js'),{ type=>'text/javascript' });
|
||||
my $style = $session->style;
|
||||
my $url = $session->url;
|
||||
$style->setLink($url->extras('yui/build/calendar/assets/skins/sam/calendar.css'), { rel=>"stylesheet", type=>"text/css", media=>"all" });
|
||||
$style->setScript($url->extras('/yui/build/utilities/utilities.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/json/json-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/yahoo/yahoo-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/dom/dom-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/event/event-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/calendar/calendar-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui-webgui/build/i18n/i18n.js' ), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui-webgui/build/datepicker/datepicker.js'),{ type => 'text/javascript' });
|
||||
|
||||
my $field = WebGUI::Form::Text->new($self->session,
|
||||
name => $self->get("name"),
|
||||
value => $value,
|
||||
size => $self->get("size"),
|
||||
extras => $self->get("extras") . ' onfocus="YAHOO.WebGUI.Form.DatePicker.display(this);"',
|
||||
id => $self->get('id'),
|
||||
maxlength => $self->get("maxlength"),
|
||||
);
|
||||
return $field->toHtml;
|
||||
my $field = WebGUI::Form::Text->new($self->session,
|
||||
name => $self->get("name"),
|
||||
value => $value,
|
||||
size => $self->get("size"),
|
||||
extras => $self->get("extras") . ' onfocus="YAHOO.WebGUI.Form.DatePicker.display(this);"',
|
||||
id => $self->get('id'),
|
||||
maxlength => $self->get("maxlength"),
|
||||
);
|
||||
return $field->toHtml;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -214,38 +214,44 @@ Renders a date picker control.
|
|||
=cut
|
||||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $value;
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $value;
|
||||
# This should probably be rewritten as a cascading ternary
|
||||
if (!$self->get("defaultValue")
|
||||
if (!$self->get("defaultValue")
|
||||
|| $self->get("defaultValue") =~ m/^\d+$/
|
||||
|| !$self->get("value")
|
||||
|| $self->get("value") =~ m/^\d+$/) {
|
||||
# Epoch format
|
||||
$value = $self->session->datetime->epochToSet($self->getOriginalValue,1);
|
||||
} else {
|
||||
# MySQL format
|
||||
$value = $self->getOriginalValue;
|
||||
# Fix time zone
|
||||
$value = WebGUI::DateTime->new($self->session, mysql => $value)
|
||||
# Epoch format
|
||||
$value = $session->datetime->epochToSet($self->getOriginalValue,1);
|
||||
} else {
|
||||
# MySQL format
|
||||
$value = $self->getOriginalValue;
|
||||
# Fix time zone
|
||||
$value = WebGUI::DateTime->new($session, mysql => $value)
|
||||
->set_time_zone($self->get("timeZone"))
|
||||
->strftime("%Y-%m-%d %H:%M:%S");
|
||||
}
|
||||
$self->session->style->setLink($self->session->url->extras('yui/build/calendar/assets/skins/sam/calendar.css'), { rel=>"stylesheet", type=>"text/css", media=>"all" });
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/yahoo/yahoo-min.js'),{ type=>'text/javascript' });
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/dom/dom-min.js'),{ type=>'text/javascript' });
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/event/event-min.js'),{ type=>'text/javascript' });
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/calendar/calendar-min.js'),{ type=>'text/javascript' });
|
||||
$self->session->style->setScript($self->session->url->extras('yui-webgui/build/datepicker/datepicker.js'),{ type=>'text/javascript' });
|
||||
}
|
||||
my $style = $session->style;
|
||||
my $url = $session->url;
|
||||
$style->setLink($url->extras('yui/build/calendar/assets/skins/sam/calendar.css'), { rel=>"stylesheet", type=>"text/css", media=>"all" });
|
||||
$style->setScript($url->extras('/yui/build/utilities/utilities.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/json/json-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/yahoo/yahoo-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/dom/dom-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/event/event-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/calendar/calendar-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui-webgui/build/i18n/i18n.js' ), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui-webgui/build/datepicker/datepicker.js'),{ type => 'text/javascript' });
|
||||
|
||||
return WebGUI::Form::Text->new($self->session,
|
||||
name=>$self->get("name"),
|
||||
value=>$value,
|
||||
size=>$self->get("size"),
|
||||
extras=>$self->get("extras") . ' onfocus="YAHOO.WebGUI.Form.DatePicker.display(this, true);"',
|
||||
id=>$self->get('id'),
|
||||
maxlength=>$self->get("maxlength")
|
||||
)->toHtml;
|
||||
return WebGUI::Form::Text->new($self->session,
|
||||
name=>$self->get("name"),
|
||||
value=>$value,
|
||||
size=>$self->get("size"),
|
||||
extras=>$self->get("extras") . ' onfocus="YAHOO.WebGUI.Form.DatePicker.display(this, true);"',
|
||||
id=>$self->get('id'),
|
||||
maxlength=>$self->get("maxlength")
|
||||
)->toHtml;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -3,105 +3,313 @@ use strict;
|
|||
|
||||
our $I18N = {
|
||||
|
||||
'timezone' => {
|
||||
message => q|Time Zone|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
'timezone' => {
|
||||
message => q|Time Zone|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'monday' => {
|
||||
message => q|Monday|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'monday' => {
|
||||
message => q|Monday|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'tuesday' => {
|
||||
message => q|Tuesday|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'tuesday' => {
|
||||
message => q|Tuesday|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'wednesday' => {
|
||||
message => q|Wednesday|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'wednesday' => {
|
||||
message => q|Wednesday|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'thursday' => {
|
||||
message => q|Thursday|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'thursday' => {
|
||||
message => q|Thursday|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'friday' => {
|
||||
message => q|Friday|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'friday' => {
|
||||
message => q|Friday|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'saturday' => {
|
||||
message => q|Saturday|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'saturday' => {
|
||||
message => q|Saturday|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'sunday' => {
|
||||
message => q|Sunday|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'sunday' => {
|
||||
message => q|Sunday|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'january' => {
|
||||
message => q|January|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'monday med' => {
|
||||
message => q|Mon|,
|
||||
lastUpdated => 1253198121,
|
||||
context => q|3 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'february' => {
|
||||
message => q|February|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'tuesday med' => {
|
||||
message => q|Tue|,
|
||||
lastUpdated => 1253198123,
|
||||
context => q|3 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'march' => {
|
||||
message => q|March|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'wednesday med' => {
|
||||
message => q|Wed|,
|
||||
lastUpdated => 1253198124,
|
||||
context => q|3 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'april' => {
|
||||
message => q|April|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'thursday med' => {
|
||||
message => q|Thu|,
|
||||
lastUpdated => 1253198127,
|
||||
context => q|3 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'may' => {
|
||||
message => q|May|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'friday med' => {
|
||||
message => q|Fri|,
|
||||
lastUpdated => 1253198128,
|
||||
context => q|3 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'june' => {
|
||||
message => q|June|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'saturday med' => {
|
||||
message => q|Sat|,
|
||||
lastUpdated => 1253198130,
|
||||
context => q|3 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'july' => {
|
||||
message => q|July|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'sunday med' => {
|
||||
message => q|Sun|,
|
||||
lastUpdated => 1253198097,
|
||||
context => q|3 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'august' => {
|
||||
message => q|August|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'monday short' => {
|
||||
message => q|Mo|,
|
||||
lastUpdated => 1253198121,
|
||||
context => q|2 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'september' => {
|
||||
message => q|September|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'tuesday short' => {
|
||||
message => q|Tu|,
|
||||
lastUpdated => 1253198123,
|
||||
context => q|2 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'october' => {
|
||||
message => q|October|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'wednesday short' => {
|
||||
message => q|We|,
|
||||
lastUpdated => 1253198124,
|
||||
context => q|2 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'november' => {
|
||||
message => q|November|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'december' => {
|
||||
message => q|December|,
|
||||
lastUpdated => 1031514049
|
||||
},
|
||||
'thursday short' => {
|
||||
message => q|Th|,
|
||||
lastUpdated => 1253198127,
|
||||
context => q|2 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'friday short' => {
|
||||
message => q|Fr|,
|
||||
lastUpdated => 1253198128,
|
||||
context => q|2 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'saturday short' => {
|
||||
message => q|Sa|,
|
||||
lastUpdated => 1253198130,
|
||||
context => q|2 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'sunday short' => {
|
||||
message => q|Su|,
|
||||
lastUpdated => 1253198097,
|
||||
context => q|2 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'monday 1char' => {
|
||||
message => q|M|,
|
||||
lastUpdated => 1253198121,
|
||||
context => q|1 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'tuesday 1char' => {
|
||||
message => q|T|,
|
||||
lastUpdated => 1253198123,
|
||||
context => q|1 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'wednesday 1char' => {
|
||||
message => q|W|,
|
||||
lastUpdated => 1253198124,
|
||||
context => q|1 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'thursday 1char' => {
|
||||
message => q|T|,
|
||||
lastUpdated => 1253198127,
|
||||
context => q|1 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'friday 1char' => {
|
||||
message => q|F|,
|
||||
lastUpdated => 1253198128,
|
||||
context => q|1 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'saturday 1char' => {
|
||||
message => q|S|,
|
||||
lastUpdated => 1253198130,
|
||||
context => q|1 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'sunday 1char' => {
|
||||
message => q|S|,
|
||||
lastUpdated => 1253198097,
|
||||
context => q|1 letter abbreviation for the day|
|
||||
},
|
||||
|
||||
'january' => {
|
||||
message => q|January|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'february' => {
|
||||
message => q|February|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'march' => {
|
||||
message => q|March|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'april' => {
|
||||
message => q|April|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'may' => {
|
||||
message => q|May|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'june' => {
|
||||
message => q|June|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'july' => {
|
||||
message => q|July|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'august' => {
|
||||
message => q|August|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'september' => {
|
||||
message => q|September|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'october' => {
|
||||
message => q|October|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'november' => {
|
||||
message => q|November|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'december' => {
|
||||
message => q|December|,
|
||||
lastUpdated => 1031514049,
|
||||
},
|
||||
|
||||
'january short' => {
|
||||
message => q|Jan|,
|
||||
lastUpdated => 1253201047,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'february short' => {
|
||||
message => q|Feb|,
|
||||
lastUpdated => 1253201045,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'march short' => {
|
||||
message => q|Mar|,
|
||||
lastUpdated => 1253201043,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'april short' => {
|
||||
message => q|Apr|,
|
||||
lastUpdated => 1253201042,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'may short' => {
|
||||
message => q|May|,
|
||||
lastUpdated => 1253201040,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'june short' => {
|
||||
message => q|Jun|,
|
||||
lastUpdated => 1253201038,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'july short' => {
|
||||
message => q|Jul|,
|
||||
lastUpdated => 1253201036,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'august short' => {
|
||||
message => q|Aug|,
|
||||
lastUpdated => 1253201034,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'september short' => {
|
||||
message => q|Sep|,
|
||||
lastUpdated => 1253201032,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'october short' => {
|
||||
message => q|Oct|,
|
||||
lastUpdated => 1253201030,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'november short' => {
|
||||
message => q|Nov|,
|
||||
lastUpdated => 1253201029,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'december short' => {
|
||||
message => q|Dec|,
|
||||
lastUpdated => 1253201027,
|
||||
context => q|3 letter abbreviation for the month|
|
||||
},
|
||||
|
||||
'Month' => {
|
||||
message => q|Month|,
|
||||
lastUpdated => 1253201027,
|
||||
},
|
||||
|
||||
'Year' => {
|
||||
message => q|Year|,
|
||||
lastUpdated => 1253201027,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
19
lib/WebGUI/i18n/English/Form_Date.pm
Normal file
19
lib/WebGUI/i18n/English/Form_Date.pm
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package WebGUI::i18n::English::Form_Date; ##Be sure to change the package name to match the filename
|
||||
use strict;
|
||||
|
||||
our $I18N = { ##hashref of hashes
|
||||
'Choose a date' => {
|
||||
message => q|Choose a date|,
|
||||
lastUpdated => 1253165348,
|
||||
context => q|Label for the datepicker javascript|
|
||||
},
|
||||
|
||||
'Invalid year' => {
|
||||
message => q|Please enter a valid year.|,
|
||||
lastUpdated => 1253165348,
|
||||
context => q|Label for the datepicker javascript|
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
@ -4258,12 +4258,6 @@ LongTruncOk=1</p>
|
|||
context => q{General purpose, similar to submit.},
|
||||
},
|
||||
|
||||
'save' => {
|
||||
message => q{Save},
|
||||
lastUpdated => 0,
|
||||
context => q{General purpose, similar to submit.},
|
||||
},
|
||||
|
||||
'company information' => {
|
||||
message => q{Company Information},
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
118
www/extras/yui-webgui/build/datepicker/datepicker.js
vendored
118
www/extras/yui-webgui/build/datepicker/datepicker.js
vendored
|
|
@ -1,6 +1,47 @@
|
|||
YAHOO.namespace('WebGUI.Form');
|
||||
YAHOO.WebGUI.Form.DatePicker = {
|
||||
init: function() {
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n = new WebGUI.i18n({
|
||||
namespaces : {
|
||||
'WebGUI' : [
|
||||
'submit',
|
||||
'cancel',
|
||||
],
|
||||
'Form_Date' : [
|
||||
'Choose a date',
|
||||
'Invalid year'
|
||||
],
|
||||
'DateTime' : [
|
||||
'Month', 'Year',
|
||||
'january', 'july',
|
||||
'february', 'august',
|
||||
'march', 'september',
|
||||
'april', 'october',
|
||||
'may', 'november',
|
||||
'june', 'december',
|
||||
'january short', 'july short',
|
||||
'february short', 'august short',
|
||||
'march short', 'september short',
|
||||
'april short', 'october short',
|
||||
'may short', 'november short',
|
||||
'june short', 'december short',
|
||||
'monday', 'monday med', 'monday short', 'monday 1char',
|
||||
'tuesday', 'tuesday med', 'tuesday short', 'tuesday 1char',
|
||||
'wednesday', 'wednesday med', 'wednesday short', 'wednesday 1char',
|
||||
'thursday', 'thursday med', 'thursday short', 'thursday 1char',
|
||||
'friday', 'friday med', 'friday short', 'friday 1char',
|
||||
'saturday', 'saturday med', 'saturday short', 'saturday 1char',
|
||||
'sunday', 'sunday med', 'sunday short', 'sunday 1char'
|
||||
]
|
||||
},
|
||||
onpreload : {
|
||||
fn : YAHOO.WebGUI.Form.DatePicker.postinit,
|
||||
obj : this,
|
||||
override : true
|
||||
}
|
||||
});
|
||||
},
|
||||
postinit: function() {
|
||||
this.time = {};
|
||||
this.codeSelect = false;
|
||||
var container = document.createElement('div');
|
||||
|
|
@ -13,15 +54,88 @@ YAHOO.WebGUI.Form.DatePicker = {
|
|||
YAHOO.util.Dom.generateId(cal);
|
||||
YAHOO.util.Dom.setStyle(cal, 'display', 'none');
|
||||
container.appendChild(cal);
|
||||
var i18n = YAHOO.WebGUI.Form.DatePicker.i18n;
|
||||
var config = {
|
||||
title: "Choose a date:",
|
||||
title: i18n.get('Form_Date', 'Choose a date'),
|
||||
close: true,
|
||||
DATE_FIELD_DELIMITER: '-',
|
||||
DATE_RANGE_DELIMITER: '/',
|
||||
MDY_YEAR_POSITION: 1,
|
||||
MDY_MONTH_POSITION: 2,
|
||||
MDY_DAY_POSITION: 3,
|
||||
NAVIGATOR: true
|
||||
WEEKDAYS_LONG: [
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'monday'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'tuesday'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'wednesday'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'thursday'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'friday'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'saturday'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'sunday')
|
||||
],
|
||||
WEEKDAYS_MEDIUM: [
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'monday med'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'tuesday med'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'wednesday med'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'thursday med'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'friday med'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'saturday med'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'sunday med')
|
||||
],
|
||||
WEEKDAYS_SHORT: [
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'monday short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'tuesday short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'wednesday short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'thursday short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'friday short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'saturday short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'sunday short')
|
||||
],
|
||||
WEEKDAYS_1CHAR: [
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'monday 1char'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'tuesday 1char'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'wednesday 1char'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'thursday 1char'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'friday 1char'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'saturday 1char'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'sunday 1char')
|
||||
],
|
||||
MONTHS_SHORT: [
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'january short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'february short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'march short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'april short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'may short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'june short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'july short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'august short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'september short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'october short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'november short'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'december short')
|
||||
],
|
||||
MONTHS_LONG: [
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'january'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'february'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'march'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'april'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'may'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'june'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'july'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'august'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'september'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'october'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'november'),
|
||||
YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'december')
|
||||
],
|
||||
NAVIGATOR: {
|
||||
strings : {
|
||||
'submit' : YAHOO.WebGUI.Form.DatePicker.i18n.get('WebGUI', 'submit'),
|
||||
'cancel' : YAHOO.WebGUI.Form.DatePicker.i18n.get('WebGUI', 'cancel'),
|
||||
'month' : YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'Month'),
|
||||
'year' : YAHOO.WebGUI.Form.DatePicker.i18n.get('DateTime', 'Year'),
|
||||
'invalid year' : YAHOO.WebGUI.Form.DatePicker.i18n.get('Form_Date', 'Invalid year'),
|
||||
}
|
||||
}
|
||||
};
|
||||
var firstDayOfWeek = getWebguiProperty('firstDayOfWeek');
|
||||
if (firstDayOfWeek) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue