[#38] setting workday for whole year using API

Migrated from Redmine #38 | Author: deepak ev
Status: Closed | Priority: High, I’m very impatient | Created: 2017-09-04


how to set workday for whole year through api setWorkDayInfo ($info)
Set work day schedule for company|service|provider for week_day|date

Example:

{
“start_time”:“10:00”,
“end_time”:“18:00”,
“is_day_off”:0,
“breaktime”:[{“start_time”:“14:00”,“end_time”:“15:00”}],
“index”:“1”,
“name”:“Monday”,
“date”:“”,
“unit_group_id”:“”,
“event_id”:“”
}

What i need to provide if i want to set for whole year .

Dmytro Bondarev wrote:

Set schedule for whole week, using index param.
In case you need to set for just one year you can call method for each date.

deepak ev wrote:

to set for whole week what is the index param i need to pass ?

You mean for whole year , i need to call the api 365 times?

Dmytro Bondarev wrote:

Indexes from 1 to 7.
1 - is Monday, 7 - is Sunday.

You need to call api 365 times only if you need special day for each day. Otherwise use week schedule.

deepak ev wrote:

I know that 1-Monday,2-Tuesday,3-Wednesday,4-Thursday,5-Friday,6-Saturday and 7-Sunday . My question is simple. if i wanted to set the schedule for whole week in a single API call , then what should i pass for “index” and “name”.

Dmytro Bondarev wrote:

As index you need to pass 1 for Monday, 2 for Tuesday, 3 for Wednesday, 5 for Friday, 6 for Saturday and 7 for Sunday.
As name you can pass what you want for example Monday for Monday, Tuesday for Tuesday, Wednesday for Wednesday, Thursday for Thursday, Friday for Friday, Saturday for Saturday and Sunday for Sunday.

deepak ev wrote:

So in single API call i can not set 1 week schedule if all days time schedule are same. I have to call API 7 times . Is this understanding correct?

Dmytro Bondarev wrote:

Yes.

(Short original content)