Posted by: R Manimaran | April 23, 2015

Moment Js: Change Locale in Date Time from SharePoint 2013 REST API

In the previous article I have explained about using Handlebars template and SharePoint data. For formatting the Date Time I have used Moment.js file. It has lot of helper functions and formatting options to work with Date Time.

When displaying the data time, Moment.js provides an option to change the locale. By default it will print in English. Locale details is available in the separate script file Moment.locale.js.

Include Moment.js and Moment.locale.js to project.


The above command will install the following files in your project’s script folder.

  • Moment-with-locales.js
  • Moment-with-locales.min.js
  • Moment.js
  • Moment.min.js

To do it offline, download the above files from and include to your project.

In the previous example I have wrote a Handlebar Helper method where i have used the Moment.js to format the date. Let we add the locale details to change the data time display.

English Locale:


    Handlebars.registerHelper("FormatDate", function (date) {              


        return moment(date.toString()).format('LLLL');       



Here is the output


French Locale:


    Handlebars.registerHelper("FormatDate", function (date) {              


        return moment(date.toString()).format('LLLL');       





Good thing is it support my mother tongue “Tamil”. Change the locale to “ta” and the resulted output in tamil.


Following are the list of locales supported by Moment.js



  1. nice to see tamil working with Sharepoint

  2. good one

  3. […]; […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: