本文整理汇总了PHP中format::get_date_format方法的典型用法代码示例。如果您正苦于以下问题:PHP format::get_date_format方法的具体用法?PHP format::get_date_format怎么用?PHP format::get_date_format使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类format
的用法示例。
在下文中一共展示了format::get_date_format方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calendar
/**
* see html::calendar()
*/
public static function calendar($options = [])
{
// include js & css files
if (empty($options['readonly'])) {
layout::add_js('/numbers/media_submodules/numbers_frontend_components_calendar_numbers_media_js_base.js');
layout::add_css('/numbers/media_submodules/numbers_frontend_components_calendar_numbers_media_css_base.css');
}
// font awesome icons
library::add('fontawesome');
// widget parameters
$type = $options['calendar_type'] ?? $options['type'] ?? 'date';
$widget_options = ['id' => $options['id'], 'type' => $type, 'format' => $options['calendar_format'] ?? format::get_date_format($type), 'date_week_start_day' => $options['calendar_date_week_start_day'] ?? 1, 'date_disable_week_days' => $options['calendar_date_disable_week_days'] ?? null, 'master_id' => $options['calendar_master_id'] ?? null, 'slave_id' => $options['calendar_slave_id'] ?? null];
$options['type'] = 'text';
// determine input size
$placeholder = format::get_date_placeholder($widget_options['format']);
$options['size'] = strlen($placeholder);
// set placeholder
if (!empty($options['placeholder']) && $options['placeholder'] == 'format::get_date_placeholder') {
$options['placeholder'] = $placeholder;
$options['title'] = ($options['title'] ?? '') . ' (' . $placeholder . ')';
}
if (isset($options['calendar_icon']) && ($options['calendar_icon'] == 'left' || $options['calendar_icon'] == 'right')) {
$position = $options['calendar_icon'];
if (i18n::rtl()) {
if ($position == 'left') {
$position = 'right';
} else {
$position = 'left';
}
}
$icon_type = $type == 'time' ? 'clock-o' : 'calendar';
unset($options['calendar_icon']);
if (empty($options['readonly'])) {
$icon_onclick = 'numbers_calendar_var_' . $options['id'] . '.show();';
} else {
$icon_onclick = null;
}
$icon_value = html::span(['onclick' => $icon_onclick, 'class' => 'numbers_calendar_icon numbers_prevent_selection', 'value' => html::icon(['type' => $icon_type])]);
$result = html::input_group(['value' => html::input($options), $position => $icon_value, 'dir' => 'ltr']);
$div_id = $options['id'] . '_div_holder';
$result .= html::div(['id' => $div_id, 'class' => 'numbers_calendar_div_holder']);
$widget_options['holder_div_id'] = $div_id;
} else {
$result = html::input($options);
}
// we do not render a widget if readonly
if (empty($options['readonly'])) {
layout::onload('numbers_calendar(' . json_encode($widget_options) . ');');
}
return $result;
}