Fixed bug with month-displaying and made the title bilingual
Getty Ritter
11 years ago
11 | 11 | import Data.Time (UTCTime(..)) |
12 | 12 | import Data.Time.Calendar (toGregorian) |
13 | 13 | import Data.Time.Format (formatTime) |
14 |
import Prelude (String, ($), (++), ( |
|
14 | import Prelude (String, ($), (++), (-), (==), return, Bool(..), Maybe(..), show) | |
15 | 15 | import qualified Prelude as P |
16 | 16 | import System.Locale (defaultTimeLocale) |
17 | 17 | import Text.Blaze.Html5 |
51 | 51 | title (toHtml ("Baruk Khazâd: " `T.append` pgName)) |
52 | 52 | body ! id "bg" $ do |
53 | 53 | userText |
54 |
div ! class_ "title" $ h1 |
|
54 | div ! class_ "title" $ h1 $ | |
55 | span ! class_ "bilingual" | |
56 | ! dataAttribute "english" "Axes of the Dwarves! The Dwarves are Upon You!" | |
57 | ! dataAttribute "dwarvish" "Baruk Khazâd! Khazâd ai-Mênu!" | |
58 | $ ("Baruk Khazâd! Khazâd ai-Mênu!") | |
55 | 59 | div ! class_ "nav" $ titlebar isLoggedIn |
56 | 60 | div ! class_ "main" $ pgContents |
57 | 61 | where userText = case isLoggedIn of |
175 | 179 | formatDate t = do |
176 | 180 | toMarkup (show day) |
177 | 181 | " " |
178 |
toMonth |
|
182 | toMonth (month - 1) | |
179 | 183 | ", " |
180 | 184 | toMarkup (show year) |
181 | 185 | where (year, month, day) = toGregorian (utctDay t) |