Question

Feature request: date time formatting with output locale


Userlevel 3
Badge +1

This has been answered by Zapier Support already with proposed solution to use Translate by Zapier (which works as an intermediate solution), but that requires an extra step which I think is unnecessary since Zapier’s datetime formatting library already has this built-in. Therefore this thread serves as an official feature request to Zapier’s developers to offer output locale support in Zapier’s datetime formatter.

 

I'm having a hard time finding information about localised (long) day and month names. I've searched the community forum and all various help articles, but none mention anything if the formatted date result is localised -- or info on how to make them localised. I did find your Intl.DateFormat library on Github, where there is a output locale parameter, but this seems unsupported in Zapier itself. Could you please know how to get a localised French date like Janvier, Lundi 3, 2023.

locale - A BCP 47 tag to identify the output languageType: stringDefault: The system localeExample: fr, fr-FR

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

10 replies

Userlevel 7
Badge +14

Hi @jphorn 

Good question.

Feedback and feature requests should be submitted via a ticket to Zapier Support to be logged: https://zapier.com/app/get-help

Userlevel 3
Badge +1

Thanks. I’ve submitted another more formal ticket :-)

Userlevel 6
Badge +8

Hi @jphorn!

I’d like to understand your use case a bit more, since the team that would address this feature request could be different. Are you running into this shortcoming as a user or as a developer of an integration? Can you give more information about what your overall use case is and an example of where and why you have to resort to the Translate by Zapier workaround?

Thanks!

Userlevel 3
Badge +1

Sure. This is from an end user point of view, but I posted here since I thought this was a more appropriate channel to reach Zapier’s devs :-) (and the other forums didn’t really correlate well)

Use case: I needed to match a specific post in WordPress, e.g. “This was today: Friday, January 6th 2023”, but in Dutch (“Dit was vandaag: vrijdag 6 januari 2023”). I used Scheduler by Zapier as trigger since I need to check whether this WordPress post exists at a certain time. Since Scheduler returns complete and partial date strings, I added an extra Datetime Formatter step to return my specific string. Alas Datetime formatter doesn’t support locale output, so that’s why an extra Translate step was necessary. Which I think is unnecessary, since the Zapier Intl. DateTime library DOES support locale output. It’s just not exposed in Zapier’s formatter step.

Hope this helps.

Userlevel 6
Badge +8

Hey there,

Okay, so you’re using the `Date / Time` event in Formatter and the transform you’re using is `Format` is that right? And when the input string is “vrijdag 6 januari 2023,” for example, you think the output should be the same but have an nl_NL locale code? Or are you saying there should be two input fields (input locale, output locale) that indicate how formatter should translate the string?

 

I’m just trying to write up the feature request to represent what you’re hoping for.

Userlevel 3
Badge +1

Or are you saying there should be two input fields (input locale, output locale) that indicate how formatter should translate the string?

Yes. This please. Hopefully these annotated screenshots also help. Right now I need an extra Translate step after Format Date/Time to get the translated string.

Please note the input for Date/Time in step 1 is from a Schedule by Zapier step.

 

Date/Time Formatter needs “To Locale” option. 

 

Right now formatted date/time output is only returned in locale en_us

 

Userlevel 6
Badge +8

All right, I’ve submitted that Feature Request. I can’t say if or when we might address it, but since you’re listed there as an interested party you’ll know as soon as there is anything to know.

Have a great weekend!

Userlevel 7
Badge +14

@jphorn

Instead of waiting around of a feature request to be prioritized, why not use AI?

Action: OpenAI - Send Prompt

NOTE: May take some adjusting or passing in a timestamp variable.

 

 

Userlevel 7
Badge +14

@jphorn 

Another option is to use 1 Code step with JavaScript.

 

CONFIG

 

CODE

let TS = inputData.TS; // TS = Timestamp

var date = new Date(TS);
var options = { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' };
date = date.toLocaleDateString('nl-NL', options);

output = [{date, TS}];

 

OUTPUT

 

Userlevel 3
Badge +1

@Troy Tessalone Actually that’s what I settled on (with a little help). I still think the feature request makes sense though, but I really appreciate the help and guidance!