I am quite new in elm and I am trying to create an admin panel that shows the technical support list and their available time according to their local time and their working hours. Supporter List:
init flags =
( { supportUserList =
[ { supportName = "Maynard Kaminski"
, numberOfClient = 12
, zone = "Europe/Moscow"
, startTime = "9 am"
, endTime = "1 pm"
}
, { supportName = "Belle Willett"
, numberOfClient = 8
, zone = "Canada/Eastern"
, startTime = "2 pm"
, endTime = "6 pm"
}
, { supportName = "Gaylene Hickson"
, numberOfClient = 7
, zone = "Africa/Nairobi"
, startTime = "6 pm"
, endTime = "10 pm"
}
, { supportName = "Cinthia Talbert"
, numberOfClient = 4
, zone = "Asia/Tokyo"
, startTime = "2 pm"
, endTime = "6 pm"
}
, { supportName = "Sydney Crenshaw"
, numberOfClient = 7
, zone = "Pacific/Honolulu"
, startTime = "6 am"
, endTime = "10 am"
}
]
}
, Cmd.none
)
viewSupporter : Supporter -> Html msg
viewSupporter supporter =
li []
[ text supporter.supportName
, text " "
, text " ("
, text (String.fromInt (supporter.numberOfClient))
, text ")"
, text " "
, text supporter.startTime
, text " - "
, text supporter.endTime
, text " ("
, text "local time ?"
, text ")"
]
Expected Result enter image description here
Current Result enter image description here
I was trying to check https://guide.elm-lang.org/effects/time.html and How do I get the current time in Elm?
But still could not find a solution. Here is my current code is in Eillie. Spent almost 9 hours and could not find a solution. How could I get a person's local time by their time zone value. Thanks