2022.2

Table Of Contents
DateandtimeHelpers
ThefollowingFormatHelpersworkwithdates.Adatecancontainadateandtime.
NotethatthisrequiresthedatafieldtobeofthetypeDate.TheseHelpersdon'tworkwithplaintext.
l
dateformatsadateobjectusingacustompattern.Putthepatternafterthenameofthedata
field,andencloseitindoublequotes.
Thecustompatternmayconsistofpatternletters,separatingsymbolsandquotedtext,for
example:"MMMMdd,yyyy";see"Dateandtimepatterns"onpage1180.
l
dateLongformatsadateaslongstringrepresentation,forexampleApril 1, 2022.
l
dateMediumformatsadateasmediumstringrepresentation,forexampleApr 1, 2022.
l
dateShortformatsadateasshortstringrepresentation,forexample4-1-2022.
l
dateTimeformatsadateandtimeobjectusingacustompattern.Putthepatternafterthename
ofthedatafield,andencloseitindoublequotes.
Thecustompatternmayconsistofpatternletters,separatingsymbolsandquotedtext,for
example:"yyyy.MM.ddG'at'HH:mm:ssz";see"Dateandtimepatterns"onpage1180.
l
dateTimeLongformatsadateandtimeaslongstringrepresentation,forexampleApril 1, 2022
12:00:00 EDT AM.
l
dateTimeMediumformatsadateandtimeasmediumstringrepresentation,forexampleApr 1,
2022 12:00:00 AM.
l
dateTimeShortformatsadateandtimeasshortstringrepresentation,forexample4/1/22 12:00
AM.
l
timeformatsatimeusingacustompattern.Putthepatternafterthenameofthedatafield,and
encloseitindoublequotes.
Thecustompatternmayconsistofpatternletters,separatingsymbolsandquotedtext,for
example:"'at'HH:mm:ssz";see"Dateandtimepatterns"onpage1180.
l
timeLongformatsatimeaslongstringrepresentation,forexample12:00:00 EDT AM.
l
timeMediumformatsatimeasmediumstringrepresentation,forexample12:00:00 AM.
l
timeShortformatsatimeasshortstringrepresentation,forexample12:00 AM.
Creating custom Helpers
AHelperisafunctionthatcanbeusedinanexpression.
InbothHandlebarsandOLConnect,anumberofHelpersarepredefined(see"Usingfunctionsin
expressions:Helpers"onpage766),butyoucanalsocreateyourownHelpers.(SeetheHandlebars
guide:https://handlebarsjs.com/guide/#custom-helpers.)
ThistopicexplainshowtocreateacustomHelperinOLConnect.
Page 771