[#502] How to undo previously off date for provider

Migrated from Redmine #502 | Author: Sajid Shah
Status: New | Priority: High, I’m very impatient | Created: 2020-03-29


I have provider who have setup 2020-04-04 as off day. Now i want to switch it back to regular day. “deleteSpecialDay” doesn’t work, it only works when I have different hours setup for special date. It doesn’t undo an off day. I also tried doing

		setWorkDayInfo(['date' => $date, 'unit_group_id' => $user_id]) 

but it throw error and I assume it needs start/end time etc which I don’t want.
I just want to undo day off for selected date and setup it as a regular day. Thanks

Redmine Admin wrote:

Hi, you need to pass start/end time of course.

Sajid Shah wrote:

Okay but will it not ignore the break times? Assume on 2020-04-04, provider marked it as OFF DAY but regularly the provider works 09:00 - 17:00 and has breaktime from 1-2 on every sunday. 2020-04-04 is also Sunday. Now if I just provide start and end time, will it not ignore the regular break time???

Sajid Shah wrote:

Imagine this is the regular work infor query for every Sunday

	'start_time'=>'09:00',
	'end_time'=>'17:00',
	'is_day_off' => 0,

	'breaktime' => [
		[
			'start_time'=>'13:00',
			'end_time'=>'14:00'
		]

	],

	'index'=>'7',
	'name'=>'Sunday',
	
	'date'=>'',
	'unit_group_id'=> 2,
	'event_id'=>false

Now like i said, i previously marked 2020-04-04 as day off. But now I want to enable it.. How will I do it??? Thanks

Redmine Admin wrote:

unfortunately there is no undo function in API. You have to pass all settings for workday.

Sajid Shah wrote:

That’s bad, wouldn’t it be nice to just add one? I hope this is something you can add later