FriendsOfFlarum / terms

Ask your users to accept TOS and Privacy Policy
https://discuss.flarum.org/d/11714
MIT License
14 stars 9 forks source link

Can the TOS update date use the local date #22

Closed philipsc closed 4 years ago

philipsc commented 4 years ago

Whether the TOS update date can use the local date. If you use the world coordination, it may cause the user to see the agreement modification date and the actual date. like this:

clarkwinkelmann commented 4 years ago

Hi. I'm not sure I understand your request.

Are you talking about the format used to enter the date in the policy? What's your suggestion?

Whatever format you enter the date, it's parsed and then stored as a database timestamp in your server timezone.

When the date is displayed back in the accept terms modal, we use the format chosen in the settings, which usually uses the browser local timezone.

When we display the accept date, we show both the date with the format from the settings and the raw date from the API, which Flarum returns as timezone 00:00

philipsc commented 4 years ago

First of all thank you for your reply. I chose to display the date format in ‘Terms Settings’ as ‘YYYY-MM-DD HH:mm:ss’. But the acceptance date and update date format displayed on the user terminal are inconsistent, like this, how should I solve it?

clarkwinkelmann commented 4 years ago

Actually I'm unsure why we (that's to say, "I" I suppose) used the same date format to show the "accepted at" value. I think we should just hard-code a format for everyone. That value is only visible to admins after all.

The reason there are currently two values shown is because in case the chosen date format isn't super precise, I still wanted a way to see the full date. And while the formatted date accounts for the user time zone, the full date is always shown in timezone "Zulu"/00:00

We could switch to using Flarum's humanTime helper in the "state modal", that way it's consistent with the date shown in other places in Flarum.

philipsc commented 4 years ago

Ok i understand, thanks for your reply

clarkwinkelmann commented 4 years ago

I have made the change in the newly released version 0.4.3

Now it's just like this

image

And the date can be hovered with the mouse to see the not-human-formatted version.