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

Starting day of the week #3

Open
goztrk opened this issue Jan 30, 2014 · 3 comments
Open

Starting day of the week #3

goztrk opened this issue Jan 30, 2014 · 3 comments

Comments

@goztrk
Copy link

goztrk commented Jan 30, 2014

There isn't an option for changing starting day of weeks. In some countries Monday is the first day of the week. So It must be iterate the day according to that.

@xero
Copy link
Owner

xero commented Jan 31, 2014

have a look at the project the boostrap calendar is forked from https://github.com/bichotll/bic_calendar - it's starting day is monday, not sunday. that was one of the reasons i created this fork, as an english translation. but you're probably correct, that is an option i should look into adding as a configuration option.

@emr1985
Copy link

emr1985 commented Sep 16, 2014

Solved!

        // Modify the related function
        function calculateWeekday(day,month,year){
            var dateObj = new Date(year, month, day);
            var numDay = dateObj.getDay();
            /* EMR */
            numDay -= startWeekDay;
            if(numDay == -1)
                numDay = 6;
             /* END EMR */
            return numDay;
        }

        // Initialize the param
        /* EMR */
        var startWeekDay = 0; // Default: sunday
        if (typeof args.startWeekDay != 'undefined')
            startWeekDay = args.startWeekDay;
        /* END EMR */

        // Use it in your main
        startWeekDay: 1,

@szantogeri
Copy link

👍

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

No branches or pull requests

4 participants