Localize Date Lib xypp/flarum-localize-date-lib

Datezone configure and date event lib

Localize Date Lib

License Latest Stable Version Total Downloads

A Flarum extension. Datezone configure and date event lib

Installation

As normal user, You will never have to install the extension manually.

Develop

Frontend

The timezone will be serialized to forum model on attribute xypp.localize-date.timezone.

You can use our export function to get some value

  • toServerTimezone
  • serverDateChangeAt

Backend

Use IOC to get the helper CarbonZoneHelper


$newCarbonObj = $helper->z($carbonObj);//set timezone to the carbon object

$now = $helper->now();//get current time in target timezone

Event DateChangeEvent will trigger in 00:xx:xx every day.

It's not guaranteed that the event will be triggered at exactly which minute or second.

Links

Versions

  • Version v1.0.1.

    Likely works with Flarum v1.8.9.

    Unlikely to work with Flarum v2.0.0-beta.1.

  • 1 additional versions.
  • Extension created.