Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Time Zone (fixes #102) #403

Merged
merged 3 commits into from
Apr 25, 2019

Conversation

tabascq
Copy link
Contributor

@tabascq tabascq commented Apr 20, 2019

All times displayed in the UX for players, authors, and admins now appear in the browser's local time zone, with the exception of the event creation/properties because I don't know how to do the time zone transitions for editable fields.

Internet wisdom is that the only way to do this well is to do it in Javascript because anything done on the server will use the server timezone instead of the user timezone. I searched around for a while to locate the easiest-looking version of this, and it seems to be working properly.

All times displayed in the UX for players, authors, and admins now appear in the browser's local time zone, with the exception of the event creation/properties because I don't know how to do the time zone transitions for editable fields.

Internet wisdom is that the only way to do this well is to do it in Javascript because anything done on the server will use the server timezone instead of the user timezone. I searched around for a while to locate the easiest-looking version of this, and it seems to be working properly.
@@ -65,7 +65,7 @@
}
else
{
@Html.DisplayFor(modelItem => item.SolvedTime)
<time>@item.UnlockedTime.Value.ToString("yyyy-MM-ddTHH:mm:ssZ")</time>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be item.SolvedTime?

@@ -43,7 +43,7 @@
{
<tr>
<td>
@item.TimeSubmitted
<time>@item.TimeSubmitted.ToString("yyyy-MM-ddTHH:mm:ssZ")</time>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance the format string could be part of the function so we don't have a copy-pasted string in quite so many places?

@@ -77,7 +77,7 @@
@Html.DisplayFor(modelItem => item.Hint.Cost)
</td>
<td>
@Html.DisplayFor(modelItem => item.UnlockTime)
<time>@item.UnlockTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")</time>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is the only one with a null check?

ServerCore/wwwroot/js/site.js Show resolved Hide resolved
@jenetlan jenetlan merged commit 344af2f into PuzzleServer:master Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants