Time sheet portal datepicker issue

ArnsteinB
Giga Contributor

Hi, i've been tasked to update the datepicker popup in our Time sheet portal to display weeknumbers and start each week with monday on the calendar rows. 

  $("#datetimepicker_timesheet").datetimepicker({
            format: 'YYYY-MM-DD',
            defaultDate: new Date(scope.data.weekStartsOn),
            pickTime: false,
            calendarWeeks: true,
            weekStart: 1,
            locale: MomentUtils.getMomentLocaleFormat(g_lang),
            language: MomentUtils.getMomentLocaleFormat(g_lang)
        }).on('dp.change', function(e) {
            var dateSelected = $("#week_range_from_cal").val();
            scope.data.loading = true;
            timecardPortalService.getTimeSheetByDate(dateSelected, scope.data.userId).then(function(response) {
                if (response.data.status == 'success') {
                    var timeSheetId = response.data.data.timeSheetId;
                    if (timeSheetId != scope.data.timesheetId) {
                        $timeout(function() {
                            _loadTimesheet(timeSheetId);
                        });
                    }
                    scope.data.loading = false;
                }
            });
        }).on("dp.show", function(e) {
            positionDatePicker();
            toggleDateTimePicker(true);
            makeDatePickerAccessible();
        }).on('dp.hide', function hideListener() {
            cleanUp();
        });
        datePicker = $(".bootstrap-datetimepicker-widget.dropdown-menu");
    }

 

 

i've set the updated lines to bold. 
calendarWeeks seems to work just fine,
but weekStart does not. it will always start on sunday.
i'm wondering what causes this, and/or what to do to make it display monday first



docs i've used for the datepicker:
https://bootstrap-datepicker.readthedocs.io/en/latest/options.html#weekstart

0 REPLIES 0