search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Can't hide sundays

Asked by Eduardo Luis
2 years ago.

Hi,

I'm trying to figure it out how to hide (not appears at all) Sunday from the Week view, here in the knowledgebase.
I can't do it.... Any help?

Thank you.

Answer posted by Dan Letecky [DayPilot]
2 years ago.

You should take a look at the viewType property.

It lets you hide weekends:
https://doc.daypilot.org/calendar/work-week-view/

If you only want to hide Sundays, you can use viewType="Days", days=6 and set startDate to be the Monday you need:
https://doc.daypilot.org/calendar/days-view/

Comment posted by Eduardo Luis
2 years ago.

It works... Thank you very much...

But I can't figure out how to use the startDate command.
I would like to see the Week starts every monday... and display only to saturday.

dp.viewType = "Days";
dp.days = 6;

I have this... but it shows the next 6 days and not the 6 days following last monday.

Comment posted by Dan Letecky [DayPilot]
2 years ago.

You need to calculate the Monday date using firstDayOfWeek():

var day = DayPilot.Date.today();
var monday = day.firstDayOfWeek(1);
dp.startDate = monday;
// ...
Comment posted by Eduardo Luis
2 years ago.

Awesome...
Worked like a charm!

Thank you VERY much!!!
:)

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.