定制 adamjenkins/moodle-filter_timezone 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

adamjenkins/moodle-filter_timezone

Composer 安装命令:

composer require adamjenkins/moodle-filter_timezone

包简介

Converts date/time spans inserted by the companion tiny_timezone TinyMCE plugin from the timezone they were authored in to the timezone of the viewing user

README 文档

README

Converts date/time spans inserted by the companion Timezone date/time TinyMCE plugin (tiny_timezone) from the timezone they were authored in to the timezone of the user currently viewing the page.

This filter looks for markup like:

<span class="filter_timezone" data-timestamp="1782277200" data-timezone="Asia/Tokyo">
  2026-06-24 14:00 (Asia/Tokyo)
</span>

and rewrites the visible text to the viewer's own timezone, e.g. 2026-06-24 17:00 (Pacific/Auckland) for a viewer in New Zealand. The timezone the date/time was converted to is always shown alongside it.

If this filter is disabled, the original text (with the source timezone shown in parentheses) is displayed unchanged — there is no broken or ambiguous fallback.

Requirements

  • Moodle 5.0 or later (CI-tested on Moodle 5.1 and 5.2)
  • PHP 8.2 or later
  • The tiny_timezone plugin (or any other source) producing the <span class="filter_timezone" data-timestamp="..." data-timezone="..."> markup

Installation

From GitHub: Download the ZIP, extract into filter/timezone/, then log in as admin and go to Site Administration → Notifications to run the database upgrade.

Setup

  1. Go to Site Administration → Plugins → Filters → Manage filters.
  2. Set Timezone to On.
  3. Use the tiny_timezone editor plugin to insert date/time spans, or generate the markup directly from another plugin.

Settings

Site Administration → Plugins → Filters → Timezone lets you choose the date/time display format used for converted dates. Each option is one of Moodle's own language pack format strings (e.g. strftimedatetimeshort), shown with a live rendered example so you can see exactly how it will look before saving.

Privacy

This plugin does not store any personal data.

Compatibility

Moodle PHP Status
5.2 8.3, 8.4 ✓ CI
5.1 8.2, 8.3, 8.4 ✓ CI

CI runs on PostgreSQL and MariaDB for all combinations above.

License

GNU GPL v3 or later — see http://www.gnu.org/copyleft/gpl.html

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-07-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固