Convert date in words

Accepted Solutions (1)

Accepted Solutions (1)

radzmar

MVP

29-09-2019

You can use FormCalc to convert the date into words.

Put in into the exit event of the date field.

if (not $.isNull) then

  var input = Date2Num($.formattedValue, "DD.MM.YYYY")

  var day = Choose(Num2Date(input, "D"), "First", "Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh", "Eighth", "Ninth", "Tenth", "Eleventh", "Twelfth", "Thirteenth", "Fourteenth", "Fifthteenth", "Sixteenth", "Seventeenth", "Eighteenth", "Nineteenth", "Twentieth", "Twenty-first", "Twenty-second", "Twenty-third", "Twenty-fourth", "Twenty-fifth", "Twenty-sixth", "Twenty-seventh", "Twenty-eighth", "Twenty-ninth", "Thirtieth", "Thirty-first")

  var month = Num2Date(input, "MMMM")

  var year = WordNum(Num2Date(input, "YYYY"), 0)

  TextField1 = Concat(day, " ", month, " ", year)

endif