Linux 软件免费装
Banner图

Intl DateTime Calendar

开发者 sigmarubyz
更新时间 2026年8月29日 18:01
PHP版本: 8.1 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

calendar formatting i18n internationalization datetime

下载

2.0.3 1.0.0 1.0.1 1.0.2 1.0.3 2.0.0 2.0.1 2.0.2

详情介绍:

Intl DateTime Calendar changes how dates are written on your site without changing what is stored. You pick a calendar. Your posts, archives and comments then show dates the way your readers write them. Every date stays in the database exactly as WordPress saved it. The machine readable date that search engines look for stays untouched. What it does Dates are written before the page is sent On a host with the PHP intl extension, dates are converted on the server. Readers see the right calendar immediately. There is no flicker as the page loads. Dates remain correct for anyone browsing with JavaScript turned off. Under this setup, the plugin adds no JavaScript to your pages. If your host lacks the intl extension, everything still works. The conversion moves to the browser and a small script is added to each page. Site Health tells you which method your site is using. Supported calendars Gregorian, Buddhist, Chinese, Coptic, Dangi, Ethiopic, Ethiopic Amete Alem, Hebrew, Indian, Islamic, Islamic Civil, Islamic Saudi Arabia, Islamic Tabular, Islamic Umm al-Qura, ISO 8601, Japanese, Persian and Republic of China. Supported digits Every decimal numbering system Unicode defines, which is around 77 of them. The familiar ones are listed first. Western, Arabic Indic, Eastern Arabic Indic, Bengali, Devanagari, Thai, Lao, Myanmar, Tibetan, Gurmukhi, Gujarati, Kannada, Malayalam, Odia, Tamil, Telugu, Sinhala, Khmer, Han decimal and full width. Every other script follows, each shown next to a sample of its digits. Only the systems your server can actually write are offered, so the list matches the version of ICU your host runs. You can also leave this alone and let the site language decide.

安装:

  1. Upload the intl-datetime-calendar folder to /wp-content/plugins/
  2. Activate the plugin through the Plugins menu
  3. Go to Settings, then Intl DateTime Calendar
  4. Choose a calendar, and choose your digits if you want something other than your language default
The preview on the settings page shows today's date in whatever you pick, so you can see the result before saving.

屏幕截图:

  • A Thai site showing Buddhist years with Thai digits
  • An Arabic site showing Hijri dates
  • Site Health reporting that dates are converted on the server

升级注意事项:

2.0.3 Important. Earlier 2.0.x releases converted every date WordPress formatted, including dates other plugins store and compare, which could corrupt their data. Conversion is now limited to dates being shown on a page. 2.0.2 The settings preview now shows dates in your site language rather than your own admin language. 2.0.1 Fixes a critical error that could take the front end down on sites using a language ICU does not carry, such as South Azerbaijani. Update if you run 2.0.0. 2.0.0 Dates are now written on the server. The flash of Gregorian dates while a page loads is gone. Dates remain correct without JavaScript. Adds a choice of digits for Thai, Arabic, Persian and other numerals. Fixes custom date formats, which were previously ignored. Requires PHP 8.1 and WordPress 6.5. 1.0.3 Performance update with WordPress 6.9 compatibility. Reduced database queries, removed jQuery dependency, and added minified JavaScript for faster page loads. 1.0.2 SECURITY UPDATE: Critical fix for stored XSS vulnerability (CVE-2025-8293). All users should update immediately to prevent script injection attacks by authenticated users with Contributor+ access. This patches a security issue affecting all versions up to 1.0.1. 1.0.1 Renamed main plugin file to fix compatibility with WordPress.org submission requirements 1.0.0 Initial release

常见问题:

Does this change what is stored in my database?

No. Only the text a visitor reads changes. Every date is stored exactly as WordPress stored it. You can switch calendars whenever you like. Removing the plugin puts everything back the way it was.

Will this hurt my SEO?

No. Each date keeps its machine readable HTML datetime value in the Gregorian calendar. Search engines read this value. Only the wording a person sees is converted.

Does it work with the block editor?

Yes. Dates in the Date block, Query Loop, comments and archives are all covered. This includes any custom format set on an individual block.

Can I use it in my theme?

Yes. <?php if ( function_exists( 'intl_datetime_calendar_format_date' ) ) { echo intl_datetime_calendar_format_date( '2026-08-19' ); } ?> You can pass a date string, a Unix timestamp or a DateTime object, and a second argument to choose the format. Or use the shortcode in your content. [intl_datetime date="2026-08-19" type="date"]

Can different languages use different calendars?

Yes. On a multilingual site each language can have its own calendar, so a Thai reader sees Buddhist years while an English reader on the same site sees Gregorian ones. Use the intl_datetime_calendar_calendar filter to set this up.

Another plugin reads dates from my pages and now gets confused. What do I do?

Only dates on their way to a page are converted. Scheduled jobs, REST and AJAX requests, feeds and the admin are left alone, so anything another plugin stores or compares stays Gregorian. If you still need to exclude something, use the intl_datetime_calendar_should_convert filter, or turn off server rendering on the settings page.

Can this break another plugin's data?

No. Only dates on their way to a page are converted. A plugin that stores a date, compares one, or formats one during a scheduled job gets the ordinary Gregorian value. If you write a plugin, prefer current_datetime() or get_post_datetime() for anything you intend to store, since those are not display functions in the first place.

What is the intl extension and do I need it?

It is a standard PHP extension that most hosts already provide. You do not strictly need it. However, with it, your dates are written before the page is sent instead of in the reader's browser. This is faster and works without JavaScript. Site Health tells you whether you have it.

更新日志:

2.0.3 Fixes a bug that could corrupt dates another plugin had stored. Update if you run 2.0.0, 2.0.1 or 2.0.2. Themes calling wp_date() or date_i18n() directly are no longer converted. Use intl_datetime_calendar_format_date() for those. 2.0.2 2.0.1 Fixes a fatal error that could take the front end down after switching the site language. 2.0.0 This release rebuilds how dates are formatted. Sites using the Gregorian calendar see no change at all. We check this automatically against PHP's own date function on every commit. New: Fixed: Changed: 1.0.3 1.0.2 1.0.1 1.0.0