0

Is there way to translate output of date function string in other language using jquery/js?

Actually I want to translate month string in other language(German, Spanish, French etc.).

Snap

enter image description here

For Example:

var D =  jQuery.datepicker.formatDate('MM dd yy', new Date());
alert(D);

Output In English: June 21 2013

But I want date format output in other languages, like as:

French: juin 21 2013

German: Juni 21 2013

Spanish: junio 21 2013

Portuguese: junho 21 2013

Am unable to get how do I translate month name in other language?

I found solution in PHP( setlocale(LC_TIME, 'language_name'); strftime(format sting); ) but I need it in jQuery or JS?

So guys, you could suggest me a better solution.

Frank
  • 2,285
  • 7
  • 43
  • 68
  • 1
    This is a duplicate question. Your answer can be found here: http://stackoverflow.com/a/1865228/870729 – random_user_name Jun 21 '13 at 11:55
  • http://stackoverflow.com/questions/1452681/jquery-datepicker-localization – HarryFink Jun 21 '13 at 11:55
  • @cale_b I want output string translation not for calendar-langauage, dude. – Frank Jun 21 '13 at 11:57
  • I am also facing same issue? Is there any solution u got@Frank – hvs9 Mar 23 '17 at 09:51
  • @hvs9 there are some language files come with this PHP Date Picker package, so we need to pass localization extension of the language which you want to load on fronted. – Frank Apr 05 '17 at 05:22
  • Thanks for the reply @Frank, actually I am using Java as backend, and I wanted to fix it via Javascript. I wrote some line of code to overcome this issue. :) – hvs9 Apr 05 '17 at 07:42
  • @hvs9 If you are using a jQuery Date Picker then please refer this link https://jqueryui.com/datepicker/#localization – Frank Apr 08 '17 at 06:03

0 Answers0