Skip to main content Skip to docs navigation


On this page

The locale files offer a simple way to globally or individually set the localization options without the need to hand code that everytime.

Creating Locales

There are a few examples in the source like this

const name = 'ru';

const localization = {
  today: 'Перейти сегодня',
  locale: 'ru',
  startOfTheWeek: 1

export { localization, name };

Using a locale

Load the locale file.

<script src="/path/to/locale.js"></script>

You can then either set the global default or you can it individually.

//load the RU locale

tempusDominus.locale(;//set the default options to use Russian from the plugin

const datetimepicker1 = new tempusDominus.TempusDominus(document.getElementById('datetimepicker1'));

If you want to load locales in TypeScript:

import { TempusDominus, loadLocale, locale } from '@eonasdan/tempus-dominus';

import { localization, name } from "@eonasdan/tempus-dominus/dist/locales/ru";

//load the locale
loadLocale({localization, name});

//set globally

var datetimepicker1 = new TempusDominus(document.getElementById('datetimepicker1'));

//or set per picker