Tarayıcıda Yerel Ayar Yükleme
Yerel ayar dosyaları isteğe bağlı olarak yüklenir.
html
<script src="path/to/dayjs/locale/de.js"></script>
<script>
dayjs.locale('de'); // Yerel ayarı global olarak ayarla
dayjs().locale('de').format(); // Yerel ayarı belirli bir örnek için kullan
</script>
Yerel ayar nesnesini daha sonra kullanmak üzere alın.
html
<script src="path/to/dayjs/locale/de.js"></script>
<!-- Yerel ayarı window.dayjs_locale_NAME şeklinde yükleyin -->
<script>
var customLocale = window.dayjs_locale_zh_cn; // zh-cn -> zh_cn
</script>
Day.js, CDN üzerinden de kullanılabilir.
html
<!-- CDN örneği (jsDelivr) -->
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/locale/zh-cn.js"></script>
<script>
dayjs.locale('zh-cn');
</script>