diff -Naru moodle/lib/form/dateselector.php moodle194+/lib/form/dateselector.php
--- moodle/lib/form/dateselector.php 2007-04-14 11:10:30.000000000 +0900
+++ moodle194+/lib/form/dateselector.php 2009-04-09 19:41:45.000000000 +0900
@@ -76,9 +76,20 @@
for ($i=$this->_options['startyear']; $i<=$this->_options['stopyear']; $i++) {
$years[$i] = $i;
}
+
+ preg_match_all('/%[dBmY]/', get_string("strftimedate"), $dmatches ); //t-kita 20090407
+ $dmatches0 = $dmatches[0];
+ if (count($dmatches0)!=3){ $dmatches0 = array('%d','%B','%Y'); }
+ foreach ($dmatches0 as $dpiece){
+ if ($dpiece=='%d'){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true);
+ }elseif (($dpiece=='%B') || ($dpiece=='%m')){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true);
+ }elseif ($dpiece=='%Y'){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true);
+ }
+ }
+
// If optional we add a checkbox which the user can use to turn if on
if($this->_options['optional']) {
$this->_elements[] =& MoodleQuickForm::createElement('checkbox', 'off', null, get_string('disable'), $this->getAttributes(), true);
diff -Naru moodle/lib/form/datetimeselector.php moodle194+/lib/form/datetimeselector.php
--- moodle/lib/form/datetimeselector.php 2007-08-10 01:56:36.000000000 +0900
+++ moodle194+/lib/form/datetimeselector.php 2009-04-09 19:41:49.000000000 +0900
@@ -81,9 +81,20 @@
for ($i=0; $i<60; $i+=$this->_options['step']) {
$minutes[$i] = sprintf("%02d",$i);
}
+
+ preg_match_all('/%[dBmY]/', get_string("strftimedate"), $dmatches ); //t-kita 20090407
+ $dmatches0 = $dmatches[0];
+ if (count($dmatches0)!=3){ $dmatches0 = array('%d','%B','%Y'); }
+ foreach ($dmatches0 as $dpiece){
+ if ($dpiece=='%d'){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true);
+ }elseif (($dpiece=='%B') || ($dpiece=='%m')){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true);
+ }elseif ($dpiece=='%Y'){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true);
+ }
+ }
+
if (right_to_left()) { // Switch order of elements for Right-to-Left
$this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true);
$this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true);
diff -Naru moodle/lib/weblib.php moodle194+/lib/weblib.php
--- moodle/lib/weblib.php 2009-04-04 00:14:55.000000000 +0900
+++ moodle194+/lib/weblib.php 2009-04-09 19:35:56.000000000 +0900
@@ -5523,12 +5523,22 @@
// Note: There should probably be a fieldset around these fields as they are
// clearly grouped. However this causes problems with display. See Mozilla
// bug 474415
+
+ preg_match_all('/%[dBmY]/', get_string("strftimedate"), $dmatches ); //t-kita 20090407
+ $dmatches0 = $dmatches[0];
+ if (count($dmatches0)!=3){ $dmatches0 = array('%d','%B','%Y'); }
+ foreach ($dmatches0 as $dpiece){
+ if ($dpiece=='%d'){
$result.='';
$result.=choose_from_menu($days, $day, $currentdate['mday'], '', '', '0', true);
+ }elseif (($dpiece=='%B') || ($dpiece=='%m')){
$result.='';
$result.=choose_from_menu($months, $month, $currentdate['mon'], '', '', '0', true);
+ }elseif ($dpiece=='%Y'){
$result.='';
$result.=choose_from_menu($years, $year, $currentdate['year'], '', '', '0', true);
+ }
+ }
if ($return) {
return $result;