Ngx-bootstrap: Setup startingDay/first day of week to monday

Created on 11 Sep 2017  路  17Comments  路  Source: valor-software/ngx-bootstrap

Hello,

I would like to ask how to set first day of the week to Monday. As I read through the library I can see that in the DatepickerConfig there is option to set up startingDay to something else as 0 (which defaults to Sunday).
However setting like:

gets me an error:
Can't bind to 'startingDay' since it isn't a known property of 'input'

and bsConfig has no such property as starting day or something similar.
Changing local does not effect this option. What am I missing ? Big thanks

comp(datepicker)

Most helpful comment

@valorkin I can't find how I can set the startingDay with 5.2.x.
Any hints?

All 17 comments

In the UK we quite often use Monday as the first day of the week in calendars, so this is quite an important feature.
Some other calendar/date components i've used link it into the locale too, so locale en-gb would automatically set the start day of the week value to Monday.

(I think that DatepickerConfig is the old datepicker component)

In fact, looking at the ngx-bootstrap locale source, first day of the week is defined in locale, and in the en-gb locale, but it does not change the first day to Monday when you change the locale to en-gb on the demo page.

We use Czech locale with first day Monday, which is defined in the locale file, but datepicker shows Sunday as first day anyway. We would appreciate, if this could be fixed.

same for ru locale

same for es locale

fixed with #2330
should be available in ngx-bootstrap@next

@valorkin I updated to ngx-bootstrap@next and still no changes even if I set locale fr. (language of day and months are ok but not the starting day)
angular : 4.3
angular-cli: 1.4.3
ngx-bootstrap: 2.0.0-beta.5
image

Sorry I was closing a bunch of duplicated issue, to have clear roadmap. This issue is duplicate of older one, add starting day input is on roadmap

@valorkin
Is the said Roadmap visible anywhere? And could you please link the related Issue or re-open this one?

reproducible again

fixed once and for all http://localhost:4200/#/datepicker#locales
:D

Will this be released as a bug fix to 1.9?

has this been fixed?

You can do this by changing dow:0 to dow:1 in
ngx-bootstrap\chronos\locale\locale.defaults.js. in file.

eg:
export var defaultLocaleWeek = {
//dow: 0
dow: 1,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 1st is the first week of the year.
};

@valorkin I can't find how I can set the startingDay with 5.2.x.
Any hints?

How do you set this in the current version?

Was this page helpful?
0 / 5 - 0 ratings