xypp / flarum-localize-date-lib
Datezone configure and date event lib
Installs: 460
Dependents: 3
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:flarum-extension
Requires
- flarum/core: ^1.2.0
This package is auto-updated.
Last update: 2024-11-22 16:27:55 UTC
README
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.