creame/elementor-datepicker-localization

为Elementor表单日期选择器加载当前网站区域设置

1.3.0 2020-08-14 14:58 UTC

This package is auto-updated.

Last update: 2024-09-15 01:22:08 UTC


README

为Elementor表单日期选择器加载当前网站区域设置。

安装

Composer

推荐方法Roots BedrockWP-CLI

$ composer require creame/elementor-datepicker-localization
$ wp plugin activate elementor-datepicker-localization

手动

  • 下载 zip文件
  • 解压到您的站点插件文件夹
  • 通过WordPress激活

WP-CLI

$ wp plugin install https://github.com/creame/elementor-datepicker-localization/archive/master.zip --activate

要求

使用方法

安装、激活即可!

过滤器

您可以使用 'elementor/datepicker/locale' 更改本地化语言,使用 'elementor/datepicker/format' 更改日期格式,并使用 'elementor/datepicker/24h' 将时间选择器更改为24小时制。

放置在您的主题的functions.php文件中。

// Example, force 'es' language
add_filter( 'elementor/datepicker/locale', function(){ return 'es'; } );

// Example, change date format to dd/mm/yyyy
add_filter( 'elementor/datepicker/format', function(){ return 'd/m/Y'; } );

// Use 24h format on time input
add_filter( 'elementor/datepicker/24h', '__return_true' );

支持

变更日志

1.3.0 - 2020年8月14日

  • 添加了原生的HTML输出并应用日期格式

1.2.0 - 2019年11月26日

  • 修复了当datepickr不存在时的js错误

1.1.0 - 2019年11月26日

  • 添加了 'elementor/datepicker/24h' 过滤器
  • 修复了当更改默认日期格式时日期字段模式抛出表单验证错误的问题

1.0.0 - 2019年11月20日

  • 首次发布