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.0.

    Likely works with Flarum v1.8.5.

  • Extension created.