EventNotifier should show dates/times in the client's timezone

This commit is contained in:
2026-09-29 18:58:22 +01:00
parent cbe461ac26
commit d6f3d622dd
6 changed files with 7787 additions and 14 deletions
@@ -60,6 +60,20 @@ native bool EventNotifier_GetEvent(int index, any[] ev, int size = sizeof(EventI
*/
native void EventNotifier_Refresh();
/**
* Formats a timestamp in the client's own timezone (looked up via GeoIP),
* e.g. "Thu 01 Oct 2026, 20:00 BST". Clients whose timezone is unknown get
* sm_event_fallback_timezone.
*
* @param client Client index, 0 for the fallback timezone.
* @param timestamp Unix timestamp (UTC).
* @param buffer Destination buffer.
* @param maxlen Size of buffer.
* @param withYear Whether to include the year.
* @error Invalid client index.
*/
native void EventNotifier_FormatClientTime(int client, int timestamp, char[] buffer, int maxlen, bool withYear = true);
/**
* Called after every successful fetch, once the event list has been replaced.
*/
@@ -136,6 +150,7 @@ public SharedPlugin __pl_EventNotifier =
MarkNativeAsOptional("EventNotifier_FindEventByNumber");
MarkNativeAsOptional("EventNotifier_GetEvent");
MarkNativeAsOptional("EventNotifier_Refresh");
MarkNativeAsOptional("EventNotifier_FormatClientTime");
}
#endif