Skip to content

Commit

Permalink
fix: use RFC 3339 string for date conversion (#2782)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabine authored Oct 18, 2024
1 parent 1b25bec commit ff5c2aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ocamlorg_frontend/components/cards.eml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ module Event = struct
match date with
| Some { yyyy_mm_dd; utc_hh_mm } ->
(match utc_hh_mm with
| Some time -> yyyy_mm_dd ^ " " ^ time ^ " UTC"
| Some time -> yyyy_mm_dd ^ "T" ^ time ^ "Z"
| None -> yyyy_mm_dd)
| None -> "N/A"

let format_date_req (date : Data.Event.utc_datetime) : string =
match date.utc_hh_mm with
| Some time -> date.yyyy_mm_dd ^ " " ^ time ^ " UTC"
| Some time -> date.yyyy_mm_dd ^ "T" ^ time ^ "Z"
| None -> date.yyyy_mm_dd

let script =
Expand All @@ -96,7 +96,7 @@ module Event = struct
Alpine.store('dateUtils', {
convertDate(dateString) {
if (dateString === 'N/A') return dateString
const hasTime = dateString.includes('UTC');
const hasTime = dateString.includes('Z');
const date = new Date(dateString);
const options = hasTime ? {
month: 'short',
Expand Down

0 comments on commit ff5c2aa

Please sign in to comment.