react-native-week-view icon indicating copy to clipboard operation
react-native-week-view copied to clipboard

Add business hours

Open sadez opened this issue 3 years ago • 5 comments

I think it will be a good feature to have, I was thinking of a props like fullcalendar :

businessHours: [ // specify an array instead
  {
    daysOfWeek: [ 1, 2, 3 ], // Monday, Tuesday, Wednesday
    startTime: '08:00', // 8am
    endTime: '18:00' // 6pm
  },
  {
    daysOfWeek: [ 4, 5 ], // Thursday, Friday
    startTime: '10:00', // 10am
    endTime: '16:00' // 4pm
  }
]

In the current version, the only way I found to do that is to add holidays or week-ends (hours outside business hours) as events and add some grey style and make them unclickable. image

sadez avatar Oct 05 '21 19:10 sadez

Yeah so you can define your "available" or "not available" time. Something à la SavvyCal https://savvycal.com

rdewolff avatar Oct 05 '21 22:10 rdewolff

This is somewhat similar to #92.

What else would the non-business hours need? Other than being non-pressable and from a different color. Or what would the business hours need?

pdpino avatar Oct 06 '21 03:10 pdpino

This is somewhat similar to #92.

What else would the non-business hours need? Other than being non-pressable and from a different color. Or what would the business hours need?

Pressable or non-pressable should be optional I think, the only thing essential is making non-business hours with grey as color or different color (it can have events)

sadez avatar Oct 06 '21 09:10 sadez

Thanks for the answer. Indeed this is very similar to the timeslot use-case, something like changing the background style of the grid without affecting the events too much.

For now, I would kindly suggest you to keep using the current workaround that you mentioned, i.e. using dummy grey events. I do not see a clear way to implement this soon, and there are other features that have precedence. In the long-term we could definitely add this, good to know there are more use-cases for this!

In any case, we are open to suggestions or more ideas into more requeriments of this, how to tackle this, etc (or PRs :slightly_smiling_face:)

pdpino avatar Oct 06 '21 15:10 pdpino

An additional tip (in case you haven't done this) you can set a lower opacity in the color for the dummy events, e.g. color: 'rgba(100,100,100,0.2)' (or in any event, for that matter)

pdpino avatar Oct 06 '21 15:10 pdpino

Any update on this one?

rdewolff avatar Jan 10 '23 14:01 rdewolff

Update: check this comment with a solution to a similar problem.

Feel free to reopen the issue if needed

pdpino avatar Feb 22 '23 22:02 pdpino

Yeah this is amazing, thanks for the update @pdpino

rdewolff avatar Feb 23 '23 09:02 rdewolff