Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Convert date in words

aka44356106
Level 4
Level 4

there is any way to convert Date in word

something like that   19/05/2019 convert in Nineteenth May Two Thousand Nineteen.

plz help

1 Accepted Solution
radzmar
Correct answer by
Level 10
Level 10

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

View solution in original post

4 Replies
radzmar
Level 10
Level 10

There's no such built-in function available in FormCalc or JavaScript to do so. You will have to create it yourself.

aka44356106
Level 4
Level 4

I have very little knowledge of Javascript

Pls help me to create it

radzmar
Correct answer by
Level 10
Level 10

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

View solution in original post