0

I want to use Angular material’s datepiker.

I would like to know how to make it start on Monday and not on Sunday.

Also for the date, when I select it, I have for example 24/05/2018 00:00 gmt+2:00. How to have the exact time without +2. 'Cause if I don’t, I’m going backend 23/05/2018 22:00

Edric
  • 18,215
  • 11
  • 68
  • 81
dna
  • 229
  • 1
  • 4
  • 15

3 Answers3

0

I would like to know how to make it start on Monday and not on Sunday.

I couldn't find anything in the API. So, I don't think you can do it.

How to have the exact time without +2.

Well you can simply change the date format. Look at this answer

gunjit
  • 109
  • 6
0

You can write your own DateAdapter class, and provide this class in app.module.

You can find similar answer here.

diabolique
  • 228
  • 1
  • 8
  • This solution is to start the calendar on Monday. But how to do for now to not +2 – dna May 31 '19 at 14:36
  • So just to get this straight, you want to have what time when you click on certain date in calendar, because, if you want to have different time, you can use different time format, as @gunjit answer you. – diabolique May 31 '19 at 19:38
  • When I select a date I have for example 31/05/2019 00:00:00 +2. So this sends me to my backend 30/05/2019 22:00. This is incorrect. I want this to send me 31/05/2019 00:00:00 – dna May 31 '19 at 21:36
  • There is no nice solution for this. You can check this [answer](https://stackoverflow.com/questions/50743810/material-angular-6-datepicker-is-parsing-my-date-1-day-before) to see how or what can you do about this. – diabolique Jun 04 '19 at 09:08
0

This can be achieved by building a custom DateAdapter. Please visit MatDatePicker start week on monday for a Well explained answer.

Malith
  • 276
  • 2
  • 7