Im relying heavily on formatDate & the Tokens for date/time formatting to restructure a lot of dates in my files. In english this works perfectly:
formatDate (now; dddd, MMMM Do)
turns into “Monday, July 15th”.
Which is a great for turning the complex “now” date into an easily readable, user-facing text.
Problem is, I also have an output that is in the german language. There, I would need the date to read “Montag, 15. Juli”. The different order can be achieved easily, but
Monday → Montag & July → Juli, is my current obstacle.
Is there a way to achieve this with some changes to the Date/Time formatting Tokens?
Otherwise, I was thinking of using a “replace” text parser module. Is that the most efficient way to do it? I’m a bit concerned, because with 12 months and 7 days, I’m afraid I’d have to run my text through 19 separate modules - I’d probably exhaust my operations in an inefficient way.
Grateful for any ideas!
Leander
1 Like
I would use 3 switch functions and basically bring it all together and get each part separately first.
Here is the formula (I don’t know German and just looked up the translations change as you need of course )
{{switch(formatDate(now; “dddd”); “Monday”; “Montag”; “Tuesday”; “Dienstag”; “Wednesday”; “Mittwoch”; “Thursday”; “Donnerstag”; “Friday”; “Freitag”; “Saturday”; “Samstag”; “Sunday”; “Sonntag”)}}, {{switch(formatDate(now; “MMMM”); “January”; “Januar”; “February”; “Februar”; “March”; “März”; “April”; “April”; “May”; “Mai”; “June”; “Juni”; “July”; “Juli”; “August”; “August”; “September”; “September”; “October”; “Oktober”; “November”; “November”; “December”; “Dezember”)}} {{formatDate(now; “Do”)}}
5 Likes
Excellent @Mr.Make, thank you - this seems to be working indeed! I had to remove all the " from the formula, as that seemed to confuse the function (spitting out an empty result). But after I ran it without the ", it seems to be working as intended. I’m running a few more tests tomorrow, but I’m cofnident that this does the trick. Thank you again!
2 Likes
Of course have a great one!!