Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to localize names of days and moths? #218

Open
AndyZotya opened this issue Apr 12, 2023 · 2 comments
Open

How to localize names of days and moths? #218

AndyZotya opened this issue Apr 12, 2023 · 2 comments

Comments

@AndyZotya
Copy link

I still don't understand how to localize a calendar. Could you provide an example?

@AndyZotya
Copy link
Author

This code working: rome(rome_d, { weekStart: 1, initialValue: '2023-04-11 00:00', time: false, weekdayFormat: ['Нд','Пн','Вт','ср','Чт','Пт','Сб'] });
But this don't rome(rome_d, { weekStart: 1, initialValue: '2023-04-11 00:00', time: false, weekdayFormat: ['Нд','Пн','Вт','ср','Чт','Пт','Сб'], monthFormat: ['Січень','Лютий','Березень','Квітень','Травень','Червень','Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'] });

@Aiderlei
Copy link

Aiderlei commented Jan 17, 2024

You can basically do something like this:

let moment = require('moment')
import rome from '@bevacqua/rome/dist/rome.js'
import '@bevacqua/rome/dist/rome.css'

let locale = document.body.dataset.locale
moment.locale(locale)
rome.use(moment)

const datePicker = rome(element, { time: false })

Note that I did not package the code as a component for demonstration purpose. You can adjust it to your setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants