Skip to content

Commit

Permalink
updated docs (#2675)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eonasdan authored Sep 30, 2022
1 parent 86d50b4 commit 6d0e929
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/docs/partials/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,25 @@ <h2 id='using'>Using a locale</h2>
const datetimepicker1 = new tempusDominus.TempusDominus(document.getElementById(&#39;datetimepicker1&#39;));
datetimepicker1.locale(tempusDominus.locales.ru.name);</code>
</pre>
<p>
If you want to load locales in TypeScript:
</p>
<pre>
<code class='language-js'>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
locale(name);

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

//or set per picker
datetimepicker1.locale(name);</code>
</pre>
</div>

<div id='subToc' class='d-none'>
Expand Down

0 comments on commit 6d0e929

Please sign in to comment.