本文整理匯總了PHP中Contao\Date::formatToJs方法的典型用法代碼示例。如果您正苦於以下問題:PHP Date::formatToJs方法的具體用法?PHP Date::formatToJs怎麽用?PHP Date::formatToJs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Contao\Date
的用法示例。
在下文中一共展示了Date::formatToJs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: row
//.........這裏部分代碼省略.........
if (in_array($this->strInputName, $paletteFields) || \Input::get('act') == 'overrideAll') {
$objWidget->validate();
if ($objWidget->hasErrors()) {
// Skip mandatory fields on auto-submit (see #4077)
if (\Input::post('SUBMIT_TYPE') != 'auto' || !$objWidget->mandatory || $objWidget->value != '') {
$this->noReload = true;
}
} elseif ($objWidget->submitInput()) {
$varValue = $objWidget->value;
// Sort array by key (fix for JavaScript wizards)
if (is_array($varValue)) {
ksort($varValue);
$varValue = serialize($varValue);
}
// Convert file paths in src attributes (see #5965)
if ($varValue && isset($arrData['eval']['rte']) && strncmp($arrData['eval']['rte'], 'tiny', 4) === 0) {
$varValue = \StringUtil::srcToInsertTag($varValue);
}
// Save the current value
try {
$this->save($varValue);
} catch (\Exception $e) {
$this->noReload = true;
$objWidget->addError($e->getMessage());
}
}
}
}
$wizard = '';
$strHelpClass = '';
// Date picker
if ($arrData['eval']['datepicker']) {
$rgxp = $arrData['eval']['rgxp'];
$format = \Date::formatToJs(\Config::get($rgxp . 'Format'));
switch ($rgxp) {
case 'datim':
$time = ",\n timePicker:true";
break;
case 'time':
$time = ",\n pickOnly:\"time\"";
break;
default:
$time = '';
break;
}
$wizard .= ' ' . \Image::getHtml('assets/datepicker/images/icon.svg', '', 'title="' . \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['datepicker']) . '" id="toggle_' . $objWidget->id . '" style="cursor:pointer"') . '
<script>
window.addEvent("domready", function() {
new Picker.Date($("ctrl_' . $objWidget->id . '"), {
draggable: false,
toggle: $("toggle_' . $objWidget->id . '"),
format: "' . $format . '",
positionOffset: {x:-211,y:-209}' . $time . ',
pickerClass: "datepicker_bootstrap",
useFadeInOut: !Browser.ie,
startDay: ' . $GLOBALS['TL_LANG']['MSC']['weekOffset'] . ',
titleFormat: "' . $GLOBALS['TL_LANG']['MSC']['titleFormat'] . '"
});
});
</script>';
}
// Color picker
if ($arrData['eval']['colorpicker']) {
// Support single fields as well (see #5240)
$strKey = $arrData['eval']['multiple'] ? $this->strField . '_0' : $this->strField;
$wizard .= ' ' . \Image::getHtml('pickcolor.svg', $GLOBALS['TL_LANG']['MSC']['colorpicker'], 'title="' . \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['colorpicker']) . '" id="moo_' . $this->strField . '"') . '