Google Apps Script toLocaleDateString not working

I am trying to run in a GAS script

function test(){
var options = { year: 'numeric', month: 'long', day: 'numeric' },
locale="ru-RU",
data= (new Date()).toLocaleDateString(locale, options);

Browser.msgBox(data);
}

But google always returns the same format no matter what I type in the locale.

How to fix it?

+4
source share
1 answer

Script applications may not respond to advanced options toLocaleDateString(). If you use HTML in your application, I will try to do the conversion inside the Script tag to HTML, and not on the server side .gs.

+1
source

All Articles