BadChoice / RVCalendarWeekView

Simple but powerful Calendar Week View for iOS
MIT License
101 stars 24 forks source link

How to: Start week from Monday #20

Open rutmb opened 8 years ago

rutmb commented 8 years ago

Hello, dear friend! Big thanks you for your pod file and for your work. It's very helpful!

It will be great if you help me with few questions:

1) Is is possible to start the week from Monday? 2) Is it possible to view the past weeks? 3) How can I add no scrollable view to the top left corner (upper than TimeRowHeader)?

BadChoice commented 8 years ago

Hi,

  1. For the week to start on monday, it is really easy but you need to modify the CalendarLayout file, there is a 0 and 6 to know for saturday/sunday, you can easily swap it, In fact, I believe there is a function that tells you wich is the starting day of the locale that would be perfecte, feel free to PR it if you can fix it

  2. Yeah, it should be pretty easy, in weekview there is a function GroupEventsByDay that adds all the days to show, you can just extend it in your own weekview calling super and then just adding the dates before.

  3. If you want something that wont ever move, just add a subvier on top of the weekview

eak65 commented 7 years ago

Can you please supply more detail here. I followed the steps and I am still having issues with step 1. Where is the function that returns starting day?

mmmcompanies commented 6 years ago

Hi

  1. Is is possible to start the week from Monday?

    yes Just change in @implementation MSWeekView Method -(void)groupEventsBySection{

    NSDate date = [NSDate parse:NSDate.today.toDateTimeString timezone:@"device"]; to replace with NSDate date = [NSDate parse:NSDate.weekStart.toDateTimeString timezone:@"device"];

simulator screen shot - iphone 6s - 2018-03-06 at 16 04 50