-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Display discords timestamps via <:t:timestamp_unix:f>
#3719
Conversation
use Discord timestamp format https://discord.com/developers/docs/reference#message-formatting-formats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all:
- please give the PR a descriptive title
- please actually run the
Checklist
(not only checking the boxes) ^^
About the functionality:
This kind of undermines the ability to set the timezone of the uptime server and instead hands that off to discord.
- The problem I see: is this transparent to the users or do we need to change this from
"Time"
to something like"Time (client-locale)"
(I am not super happy with that as well) - I have attached two comments which fix the formatting issues raised by
check-linters
- Could you attach a before and after screenshot?
- Have you made sure that the code you wrote and the previos code is identical?
From what I looked at, the time of theheartbeatJSON
and the current time might be different. Could you use the timestamp all other notification providers use as well?
The variable you are replacing gets created here:
uptime-kuma/server/model/monitor.js
Lines 1288 to 1290 in f0c54be
heartbeatJSON["timezone"] = await UptimeKumaServer.getInstance().getTimezone(); heartbeatJSON["timezoneOffset"] = UptimeKumaServer.getInstance().getTimezoneOffset(); heartbeatJSON["localDateTime"] = dayjs.utc(heartbeatJSON["time"]).tz(heartbeatJSON["timezone"]).format(SQL_DATETIME_FORMAT);
As I read this code (and the lines previosly)"time"
might be slightly different from the time of notification.
Could you use the same time-reference as well?
Should convert the time from |
use heartbeatJSON["time"] instead of Date.now()
changed Date.now() to heartbeatJSON["time"] |
@LifeIsAParadox can you explain this difference? (I have not looked into this, but it seems a bit strange) |
<:t:timestamp_unix:f>
@LifeIsAParadox |
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]:
Description
Fixes #543
Type of change
Please delete any options that are not relevant.
use Discord timestamp format
https://discord.com/developers/docs/reference#message-formatting-formats
Checklist
(including JSDoc for methods)
Screenshots (if any)
Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.