diff --git a/src/models/index.js b/src/models/index.js index f69cbfd..15b6226 100644 --- a/src/models/index.js +++ b/src/models/index.js @@ -224,12 +224,12 @@ const Hunts = { isHidden(hunt) { if (!hunt.hidden_until_start || !hunt.start_date) return false; - return new Date(hunt.start_date + 'Z') > new Date(); + return new Date(hunt.start_date) > new Date(); }, hasStarted(hunt) { if (!hunt.start_date) return true; - return new Date(hunt.start_date + 'Z') <= new Date(); + return new Date(hunt.start_date) <= new Date(); }, resetScans(id) { diff --git a/src/views/admin/create-hunt.ejs b/src/views/admin/create-hunt.ejs index a3db4f8..91c9daf 100644 --- a/src/views/admin/create-hunt.ejs +++ b/src/views/admin/create-hunt.ejs @@ -57,4 +57,17 @@ + + <%- include('../partials/footer') %> diff --git a/src/views/admin/dashboard.ejs b/src/views/admin/dashboard.ejs index a352678..ad511c0 100644 --- a/src/views/admin/dashboard.ejs +++ b/src/views/admin/dashboard.ejs @@ -23,9 +23,9 @@
- <% if (hunt.hidden_until_start && hunt.start_date && new Date(hunt.start_date + 'Z') > new Date()) { %> + <% if (hunt.hidden_until_start && hunt.start_date && new Date(hunt.start_date) > new Date()) { %> Hidden - <% } else if (hunt.start_date && new Date(hunt.start_date + 'Z') > new Date()) { %> + <% } else if (hunt.start_date && new Date(hunt.start_date) > new Date()) { %> Upcoming <% } %> Manage diff --git a/src/views/admin/edit-hunt.ejs b/src/views/admin/edit-hunt.ejs index a718d60..a558261 100644 --- a/src/views/admin/edit-hunt.ejs +++ b/src/views/admin/edit-hunt.ejs @@ -32,7 +32,7 @@
+ data-utc="<%= hunt.start_date || '' %>">
When the hunt becomes active. Leave blank to start immediately.
@@ -45,7 +45,7 @@
+ data-utc="<%= hunt.expiry_date || '' %>">
Leave blank for no expiry.
@@ -53,6 +53,30 @@
+ +
Danger Zone
diff --git a/src/views/home.ejs b/src/views/home.ejs index 484090f..d977967 100644 --- a/src/views/home.ejs +++ b/src/views/home.ejs @@ -56,9 +56,9 @@ <% if (hunt.expiry_date) { %> · Expires <% } %>
- <% if (hunt.expiry_date && new Date(hunt.expiry_date + 'Z') < new Date()) { %> + <% if (hunt.expiry_date && new Date(hunt.expiry_date) < new Date()) { %> Expired - <% } else if (hunt.start_date && new Date(hunt.start_date + 'Z') > new Date()) { %> + <% } else if (hunt.start_date && new Date(hunt.start_date) > new Date()) { %> Upcoming <% } else { %> <%= hunt.package_count %> packages diff --git a/src/views/hunt/list.ejs b/src/views/hunt/list.ejs index 9bdda7f..f4400a4 100644 --- a/src/views/hunt/list.ejs +++ b/src/views/hunt/list.ejs @@ -16,14 +16,14 @@ <% if (hunt.expiry_date) { %> · Expires <% } %> - <% if (hunt.start_date && new Date(hunt.start_date + 'Z') > new Date()) { %> + <% if (hunt.start_date && new Date(hunt.start_date) > new Date()) { %> · Starts <% } %> - <% if (hunt.expiry_date && new Date(hunt.expiry_date + 'Z') < new Date()) { %> + <% if (hunt.expiry_date && new Date(hunt.expiry_date) < new Date()) { %> Expired - <% } else if (hunt.start_date && new Date(hunt.start_date + 'Z') > new Date()) { %> + <% } else if (hunt.start_date && new Date(hunt.start_date) > new Date()) { %> Upcoming <% } else { %> <%= hunt.package_count %> packages