reformat
This commit is contained in:
parent
f757078d80
commit
8ad6997c66
|
@ -119,12 +119,10 @@ instance Show Card where
|
|||
where
|
||||
truncateDesc :: Text -> Text
|
||||
truncateDesc input =
|
||||
let
|
||||
(fstLine, _) = T.break (== '\n') input
|
||||
in
|
||||
if T.length fstLine > 30
|
||||
then T.take 30 fstLine <> "..."
|
||||
else fstLine
|
||||
let (fstLine, _) = T.break (== '\n') input
|
||||
in if T.length fstLine > 30
|
||||
then T.take 30 fstLine <> "..."
|
||||
else fstLine
|
||||
|
||||
authHeaders :: Text -> Text -> Option Https
|
||||
authHeaders username password =
|
||||
|
@ -176,20 +174,18 @@ createCard hostname username password boardId stackId title description date wee
|
|||
let url = baseUrl hostname /: "boards" /: T.pack (show boardId) /: "stacks" /: T.pack (show stackId) /: "cards"
|
||||
let (_, dayOfYear) = toOrdinalDate date.localDay
|
||||
let (year, month, day) = toGregorian date.localDay
|
||||
let
|
||||
expandedTitle =
|
||||
T.replace "%YY" (T.pack $ show year)
|
||||
$ T.replace "%MM" (T.pack $ show month)
|
||||
$ T.replace "%DD" (T.pack $ show day) title
|
||||
let
|
||||
body =
|
||||
object
|
||||
[ "title" .= expandedTitle
|
||||
, "type" .= ("plain" :: Text)
|
||||
, "order" .= dayOfYear
|
||||
, "description" .= description
|
||||
, "duedate" .= localTimeToUTC timezone date
|
||||
]
|
||||
let expandedTitle =
|
||||
T.replace "%YY" (T.pack $ show year)
|
||||
$ T.replace "%MM" (T.pack $ show month)
|
||||
$ T.replace "%DD" (T.pack $ show day) title
|
||||
let body =
|
||||
object
|
||||
[ "title" .= expandedTitle
|
||||
, "type" .= ("plain" :: Text)
|
||||
, "order" .= dayOfYear
|
||||
, "description" .= description
|
||||
, "duedate" .= localTimeToUTC timezone date
|
||||
]
|
||||
runReq defaultHttpConfig $ do
|
||||
_ <- req POST url (ReqBodyJson body) ignoreResponse headers
|
||||
when (weeklyRepeats > 0) $ do
|
||||
|
|
Loading…
Reference in New Issue