1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-08 20:21:13 +02:00

More datepicker fixes

This commit is contained in:
Cameron 2013-01-22 00:20:44 -08:00
parent 5457247787
commit be5845bf46
2 changed files with 10 additions and 4 deletions

View File

@ -75,6 +75,13 @@ class convert
} }
// $datestamp += TIMEOFFSET; // $datestamp += TIMEOFFSET;
break; break;
default:
if(strpos($mask, '%') === FALSE)
{
$mask = $this->toMask($mask);
}
break;
} }
// //
@ -98,9 +105,9 @@ class convert
/** /**
* Converts from one date function mask to the other and vice-versa. * Converts to new date-mask format or vice-versa when $legacy is TRUE
*/ */
function toMask($mask) function toMask($mask, $legacy = false)
{ {
$convert = array( $convert = array(
'%Y' => 'yy', '%Y' => 'yy',
@ -129,7 +136,7 @@ class convert
$s = array_keys($convert); $s = array_keys($convert);
$r = array_values($convert); $r = array_values($convert);
if(strpos($mask, '%') === FALSE) if(strpos($mask, '%') === FALSE && $legacy == TRUE)
{ {
return str_replace($r, $s,$mask); return str_replace($r, $s,$mask);
} }

View File

@ -589,7 +589,6 @@ class e_form
); );
$defdisp = (isset($def[$type])) ? $def[$type] : $def['date']; $defdisp = (isset($def[$type])) ? $def[$type] : $def['date'];
// $defdisp = e107::getDate()->toMask($defdisp);
if ($datestamp) if ($datestamp)
{ {