1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 19:17:01 +00:00

ui: Add friendly date to Mailbox message view

- Refactor some date stuff
This commit is contained in:
James Hillyerd
2018-11-08 20:20:38 -08:00
parent d05eb10851
commit c92cd309bc
5 changed files with 54 additions and 25 deletions

View File

@@ -94,19 +94,15 @@ view session model =
viewMessage : MessageHeader -> Html Msg
viewMessage message =
tr [ Events.onClick (OpenMessage message) ]
[ td [] [ text (timestamp message.date) ]
[ td [] [ shortDate message.date ]
, td [ class "desktop" ] [ text message.from ]
, td [] [ text message.mailbox ]
, td [] [ text message.subject ]
]
-- UTILITY
timestamp : Date -> String
timestamp =
shortDate : Date -> Html Msg
shortDate date =
format
[ dayOfMonthFixed
, DateFormat.text "-"
@@ -118,3 +114,5 @@ timestamp =
, DateFormat.text " "
, amPmUppercase
]
date
|> text