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

Support for latest MomentJs #41

Open
Hendrikv1990 opened this issue Sep 25, 2017 · 0 comments
Open

Support for latest MomentJs #41

Hendrikv1990 opened this issue Sep 25, 2017 · 0 comments

Comments

@Hendrikv1990
Copy link

Hey there,

Not sure if still is still actively maintained, but I am giving it a try.

I got this issue when I upgrade rails, with that, ofcourse momentjs also updated. Then daterangepicker needs to be updated.

In daterangepicker.js line 42 > this.locale. There are some issues on the way _lang() is used. I solved it as follows. It's a bit ugly, but it would be great if a similar fix comes in the future, or if there will be support for future versions. Otherwise I will load the regular daterangepicker as a separate js file.

Thanks!

`var ld = moment().localeData()
console.log(ld._weekdaysMin.slice());

    this.locale = {
        applyLabel: 'Apply',
        cancelLabel: 'Cancel',
        fromLabel: 'From',
        toLabel: 'To',
        weekLabel: 'W',
        customRangeLabel: 'Custom Range',
        daysOfWeek: ld._weekdaysMin.slice(),
        monthNames: ld._monthsShort.slice(),
        firstDay: 0
    };`
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

1 participant