EventNotifier should show dates/times in the client's timezone
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user