2015-07-20 22:41:24 +03:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
* Easy!Appointments - Open Source Web Scheduler
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2015-07-20 22:41:24 +03:00
|
|
|
* @package EasyAppointments
|
|
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
2021-12-18 19:43:45 +03:00
|
|
|
* @copyright Copyright (c) Alex Tselegidis
|
|
|
|
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
|
|
|
* @link https://easyappointments.org
|
2015-07-20 22:41:24 +03:00
|
|
|
* @since v1.0.0
|
|
|
|
* ---------------------------------------------------------------------------- */
|
|
|
|
|
2022-01-11 12:52:58 +03:00
|
|
|
App.Utils.WorkingPlan = (function () {
|
2013-09-25 18:43:17 +03:00
|
|
|
/**
|
2016-05-14 13:28:42 +03:00
|
|
|
* Class WorkingPlan
|
|
|
|
*
|
2016-04-24 20:28:33 +03:00
|
|
|
* Contains the working plan functionality. The working plan DOM elements must be same
|
|
|
|
* in every page this class is used.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2016-04-24 20:28:33 +03:00
|
|
|
* @class WorkingPlan
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2022-01-11 12:52:58 +03:00
|
|
|
const WorkingPlan = function () {
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* This flag is used when trying to cancel row editing. It is
|
|
|
|
* true only whenever the user presses the cancel button.
|
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @type {Boolean}
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
|
|
|
this.enableCancel = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This flag determines whether the jeditables are allowed to submit. It is
|
|
|
|
* true only whenever the user presses the save button.
|
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @type {Boolean}
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
|
|
|
this.enableSubmit = false;
|
|
|
|
};
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2013-09-25 18:43:17 +03:00
|
|
|
/**
|
2016-04-24 20:28:33 +03:00
|
|
|
* Setup the dom elements of a given working plan.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @param {Object} workingPlan Contains the working hours and breaks for each day of the week.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.setup = function (workingPlan) {
|
2022-01-12 13:19:48 +03:00
|
|
|
const weekDayId = App.Utils.Date.getWeekdayId(App.Vars.first_weekday);
|
2022-01-11 12:52:58 +03:00
|
|
|
const workingPlanSorted = App.Utils.Date.sortWeekDictionary(workingPlan, weekDayId);
|
2018-07-06 02:21:24 +03:00
|
|
|
|
|
|
|
$('.working-plan tbody').empty();
|
|
|
|
$('.breaks tbody').empty();
|
2020-03-10 22:32:53 +03:00
|
|
|
|
2018-07-06 02:21:24 +03:00
|
|
|
// Build working plan day list starting with the first weekday as set in the General settings
|
2022-01-11 12:52:58 +03:00
|
|
|
const timeFormat = App.Vars.time_format === 'regular' ? 'h:mm a' : 'HH:mm';
|
2018-07-06 02:21:24 +03:00
|
|
|
|
2021-11-06 19:38:37 +03:00
|
|
|
$.each(
|
|
|
|
workingPlanSorted,
|
|
|
|
function (index, workingDay) {
|
2022-01-11 12:52:58 +03:00
|
|
|
const day = this.convertValueToDay(index);
|
2020-05-07 19:47:14 +03:00
|
|
|
|
2022-01-11 12:52:58 +03:00
|
|
|
const dayDisplayName = App.Utils.String.upperCaseFirstLetter(day);
|
2021-11-06 19:38:37 +03:00
|
|
|
|
|
|
|
$('<tr/>', {
|
|
|
|
'html': [
|
|
|
|
$('<td/>', {
|
|
|
|
'html': [
|
|
|
|
$('<div/>', {
|
|
|
|
'class': 'checkbox form-check',
|
|
|
|
'html': [
|
|
|
|
$('<input/>', {
|
|
|
|
'class': 'form-check-input',
|
|
|
|
'type': 'checkbox',
|
|
|
|
'id': index
|
|
|
|
}),
|
|
|
|
$('<label/>', {
|
|
|
|
'class': 'form-check-label',
|
|
|
|
'text': dayDisplayName,
|
|
|
|
'for': index
|
|
|
|
})
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'html': [
|
|
|
|
$('<input/>', {
|
|
|
|
'id': index + '-start',
|
|
|
|
'class': 'work-start form-control form-control-sm'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'html': [
|
|
|
|
$('<input/>', {
|
|
|
|
'id': index + '-end',
|
|
|
|
'class': 'work-start form-control form-control-sm'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}).appendTo('.working-plan tbody');
|
|
|
|
|
|
|
|
if (workingDay) {
|
|
|
|
$('#' + index).prop('checked', true);
|
2021-11-24 10:34:26 +03:00
|
|
|
$('#' + index + '-start').val(moment(workingDay.start, 'HH:mm').format(timeFormat).toLowerCase());
|
|
|
|
$('#' + index + '-end').val(moment(workingDay.end, 'HH:mm').format(timeFormat).toLowerCase());
|
2021-11-06 19:38:37 +03:00
|
|
|
|
|
|
|
// Sort day's breaks according to the starting hour
|
|
|
|
workingDay.breaks.sort(function (break1, break2) {
|
|
|
|
// We can do a direct string comparison since we have time based on 24 hours clock.
|
|
|
|
return break1.start.localeCompare(break2.start);
|
|
|
|
});
|
|
|
|
|
|
|
|
workingDay.breaks.forEach(function (workingDayBreak) {
|
|
|
|
$('<tr/>', {
|
|
|
|
'html': [
|
|
|
|
$('<td/>', {
|
|
|
|
'class': 'break-day editable',
|
|
|
|
'text': dayDisplayName
|
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'class': 'break-start editable',
|
2021-11-24 10:34:26 +03:00
|
|
|
'text': moment(workingDayBreak.start, 'HH:mm').format(timeFormat).toLowerCase()
|
2021-11-06 19:38:37 +03:00
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'class': 'break-end editable',
|
2021-11-24 10:34:26 +03:00
|
|
|
'text': moment(workingDayBreak.end, 'HH:mm').format(timeFormat).toLowerCase()
|
2021-11-06 19:38:37 +03:00
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'html': [
|
|
|
|
$('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'btn btn-outline-secondary btn-sm edit-break',
|
2021-12-13 09:52:09 +03:00
|
|
|
'title': App.Lang.edit,
|
2021-11-06 19:38:37 +03:00
|
|
|
'html': [
|
|
|
|
$('<span/>', {
|
|
|
|
'class': 'fas fa-edit'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
$('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'btn btn-outline-secondary btn-sm delete-break',
|
2021-12-13 09:52:09 +03:00
|
|
|
'title': App.Lang.delete,
|
2021-11-06 19:38:37 +03:00
|
|
|
'html': [
|
|
|
|
$('<span/>', {
|
|
|
|
'class': 'fas fa-trash-alt'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
$('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'btn btn-outline-secondary btn-sm save-break d-none',
|
2021-12-13 09:52:09 +03:00
|
|
|
'title': App.Lang.save,
|
2021-11-06 19:38:37 +03:00
|
|
|
'html': [
|
|
|
|
$('<span/>', {
|
|
|
|
'class': 'fas fa-check-circle'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
$('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'btn btn-outline-secondary btn-sm cancel-break d-none',
|
2021-12-13 09:52:09 +03:00
|
|
|
'title': App.Lang.cancel,
|
2021-11-06 19:38:37 +03:00
|
|
|
'html': [
|
|
|
|
$('<span/>', {
|
|
|
|
'class': 'fas fa-ban'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}).appendTo('.breaks tbody');
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
$('#' + index).prop('checked', false);
|
|
|
|
$('#' + index + '-start').prop('disabled', true);
|
|
|
|
$('#' + index + '-end').prop('disabled', true);
|
|
|
|
}
|
|
|
|
}.bind(this)
|
|
|
|
);
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
// Make break cells editable.
|
2020-10-20 16:03:48 +03:00
|
|
|
this.editableDayCell($('.breaks .break-day'));
|
|
|
|
this.editableTimeCell($('.breaks').find('.break-start, .break-end'));
|
2016-04-24 20:28:33 +03:00
|
|
|
};
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2018-04-12 16:03:46 +03:00
|
|
|
/**
|
2020-10-20 16:03:48 +03:00
|
|
|
* Setup the dom elements of a given working plan exception.
|
2018-04-12 16:03:46 +03:00
|
|
|
*
|
2020-10-20 16:03:48 +03:00
|
|
|
* @param {Object} workingPlanExceptions Contains the working plan exception.
|
2018-04-12 16:03:46 +03:00
|
|
|
*/
|
2020-10-20 16:03:48 +03:00
|
|
|
WorkingPlan.prototype.setupWorkingPlanExceptions = function (workingPlanExceptions) {
|
2022-01-11 12:52:58 +03:00
|
|
|
for (const date in workingPlanExceptions) {
|
|
|
|
const workingPlanException = workingPlanExceptions[date];
|
2020-10-20 16:03:48 +03:00
|
|
|
|
2021-11-06 19:38:37 +03:00
|
|
|
this.renderWorkingPlanExceptionRow(date, workingPlanException).appendTo('.working-plan-exceptions tbody');
|
2020-10-20 16:03:48 +03:00
|
|
|
}
|
2018-04-12 16:03:46 +03:00
|
|
|
};
|
|
|
|
|
2013-09-25 18:43:17 +03:00
|
|
|
/**
|
2016-05-14 13:28:42 +03:00
|
|
|
* Enable editable break day.
|
|
|
|
*
|
2016-04-24 20:28:33 +03:00
|
|
|
* This method makes editable the break day cells.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @param {Object} $selector The jquery selector ready for use.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2020-10-20 16:03:48 +03:00
|
|
|
WorkingPlan.prototype.editableDayCell = function ($selector) {
|
2022-01-11 12:52:58 +03:00
|
|
|
const weekDays = {};
|
2021-12-13 09:52:09 +03:00
|
|
|
weekDays[App.Lang.sunday] = App.Lang.sunday; //'Sunday';
|
|
|
|
weekDays[App.Lang.monday] = App.Lang.monday; //'Monday';
|
|
|
|
weekDays[App.Lang.tuesday] = App.Lang.tuesday; //'Tuesday';
|
|
|
|
weekDays[App.Lang.wednesday] = App.Lang.wednesday; //'Wednesday';
|
|
|
|
weekDays[App.Lang.thursday] = App.Lang.thursday; //'Thursday';
|
|
|
|
weekDays[App.Lang.friday] = App.Lang.friday; //'Friday';
|
|
|
|
weekDays[App.Lang.saturday] = App.Lang.saturday; //'Saturday';
|
2016-04-24 20:28:33 +03:00
|
|
|
|
2021-11-06 19:38:37 +03:00
|
|
|
$selector.editable(
|
|
|
|
function (value, settings) {
|
|
|
|
return value;
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'select',
|
|
|
|
data: weekDays,
|
|
|
|
event: 'edit',
|
|
|
|
height: '30px',
|
|
|
|
submit: '<button type="button" class="d-none submit-editable">Submit</button>',
|
|
|
|
cancel: '<button type="button" class="d-none cancel-editable">Cancel</button>',
|
|
|
|
onblur: 'ignore',
|
|
|
|
onreset: function (settings, td) {
|
|
|
|
if (!this.enableCancel) {
|
|
|
|
return false; // disable ESC button
|
|
|
|
}
|
|
|
|
}.bind(this),
|
|
|
|
onsubmit: function (settings, td) {
|
|
|
|
if (!this.enableSubmit) {
|
|
|
|
return false; // disable Enter button
|
|
|
|
}
|
|
|
|
}.bind(this)
|
|
|
|
}
|
|
|
|
);
|
2016-04-24 20:28:33 +03:00
|
|
|
};
|
2013-09-25 18:43:17 +03:00
|
|
|
|
|
|
|
/**
|
2016-05-14 13:28:42 +03:00
|
|
|
* Enable editable break time.
|
|
|
|
*
|
2016-04-24 20:28:33 +03:00
|
|
|
* This method makes editable the break time cells.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @param {Object} $selector The jquery selector ready for use.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2020-10-20 16:03:48 +03:00
|
|
|
WorkingPlan.prototype.editableTimeCell = function ($selector) {
|
2021-11-06 19:38:37 +03:00
|
|
|
$selector.editable(
|
|
|
|
function (value, settings) {
|
|
|
|
// Do not return the value because the user needs to press the "Save" button.
|
|
|
|
return value;
|
|
|
|
},
|
|
|
|
{
|
|
|
|
event: 'edit',
|
|
|
|
height: '30px',
|
|
|
|
submit: $('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'd-none submit-editable',
|
2021-12-13 09:52:09 +03:00
|
|
|
'text': App.Lang.save
|
2021-11-06 19:38:37 +03:00
|
|
|
}).get(0).outerHTML,
|
|
|
|
cancel: $('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'd-none cancel-editable',
|
2021-12-13 09:52:09 +03:00
|
|
|
'text': App.Lang.cancel
|
2021-11-06 19:38:37 +03:00
|
|
|
}).get(0).outerHTML,
|
|
|
|
onblur: 'ignore',
|
|
|
|
onreset: function (settings, td) {
|
|
|
|
if (!this.enableCancel) {
|
|
|
|
return false; // disable ESC button
|
|
|
|
}
|
|
|
|
}.bind(this),
|
|
|
|
onsubmit: function (settings, td) {
|
|
|
|
if (!this.enableSubmit) {
|
|
|
|
return false; // disable Enter button
|
|
|
|
}
|
|
|
|
}.bind(this)
|
|
|
|
}
|
|
|
|
);
|
2016-04-24 20:28:33 +03:00
|
|
|
};
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2020-10-20 16:03:48 +03:00
|
|
|
/**
|
|
|
|
* Enable editable break time.
|
|
|
|
*
|
|
|
|
* This method makes editable the break time cells.
|
|
|
|
*
|
|
|
|
* @param {String} date In "Y-m-d" format.
|
|
|
|
* @param {Object} workingPlanException Contains exception information.
|
|
|
|
*/
|
|
|
|
WorkingPlan.prototype.renderWorkingPlanExceptionRow = function (date, workingPlanException) {
|
2022-01-11 12:52:58 +03:00
|
|
|
const timeFormat = App.Vars.time_format === 'regular' ? 'h:mm a' : 'HH:mm';
|
2020-10-20 16:03:48 +03:00
|
|
|
|
|
|
|
return $('<tr/>', {
|
|
|
|
'data': {
|
|
|
|
'date': date,
|
|
|
|
'workingPlanException': workingPlanException
|
|
|
|
},
|
|
|
|
'html': [
|
|
|
|
$('<td/>', {
|
|
|
|
'class': 'working-plan-exception-date',
|
2022-01-11 12:52:58 +03:00
|
|
|
'text': App.Utils.Date.format(date, App.Vars.date_format, App.Vars.time_format, false)
|
2020-10-20 16:03:48 +03:00
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'class': 'working-plan-exception--start',
|
2021-11-24 10:34:26 +03:00
|
|
|
'text': moment(workingPlanException.start, 'HH:mm').format(timeFormat).toLowerCase()
|
2020-10-20 16:03:48 +03:00
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'class': 'working-plan-exception--end',
|
2021-11-24 10:34:26 +03:00
|
|
|
'text': moment(workingPlanException.end, 'HH:mm').format(timeFormat).toLowerCase()
|
2020-10-20 16:03:48 +03:00
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'html': [
|
|
|
|
$('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'btn btn-outline-secondary btn-sm edit-working-plan-exception',
|
2021-12-13 09:52:09 +03:00
|
|
|
'title': App.Lang.edit,
|
2020-10-20 16:03:48 +03:00
|
|
|
'html': [
|
|
|
|
$('<span/>', {
|
2020-12-08 01:10:49 +03:00
|
|
|
'class': 'fas fa-edit'
|
2020-10-20 16:03:48 +03:00
|
|
|
})
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
$('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'btn btn-outline-secondary btn-sm delete-working-plan-exception',
|
2021-12-13 09:52:09 +03:00
|
|
|
'title': App.Lang.delete,
|
2020-10-20 16:03:48 +03:00
|
|
|
'html': [
|
|
|
|
$('<span/>', {
|
2020-12-08 01:10:49 +03:00
|
|
|
'class': 'fas fa-trash-alt'
|
2020-10-20 16:03:48 +03:00
|
|
|
})
|
|
|
|
]
|
2021-11-06 19:38:37 +03:00
|
|
|
})
|
2020-10-20 16:03:48 +03:00
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2013-09-25 18:43:17 +03:00
|
|
|
/**
|
2016-04-24 20:28:33 +03:00
|
|
|
* Binds the event handlers for the working plan dom elements.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.bindEventHandlers = function () {
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* Event: Day Checkbox "Click"
|
|
|
|
*
|
|
|
|
* Enable or disable the time selection for each day.
|
|
|
|
*/
|
2020-10-20 16:03:48 +03:00
|
|
|
$('.working-plan tbody').on('click', 'input:checkbox', function () {
|
2022-01-11 12:52:58 +03:00
|
|
|
const id = $(this).attr('id');
|
2016-04-24 20:28:33 +03:00
|
|
|
|
2020-05-06 20:15:11 +03:00
|
|
|
if ($(this).prop('checked') === true) {
|
2021-11-06 19:38:37 +03:00
|
|
|
$('#' + id + '-start')
|
|
|
|
.prop('disabled', false)
|
|
|
|
.val('9:00 AM');
|
|
|
|
$('#' + id + '-end')
|
|
|
|
.prop('disabled', false)
|
|
|
|
.val('6:00 PM');
|
2016-04-24 20:28:33 +03:00
|
|
|
} else {
|
2021-11-06 19:38:37 +03:00
|
|
|
$('#' + id + '-start')
|
|
|
|
.prop('disabled', true)
|
|
|
|
.val('');
|
|
|
|
$('#' + id + '-end')
|
|
|
|
.prop('disabled', true)
|
|
|
|
.val('');
|
2016-04-24 20:28:33 +03:00
|
|
|
}
|
2013-09-25 18:43:17 +03:00
|
|
|
});
|
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* Event: Add Break Button "Click"
|
|
|
|
*
|
|
|
|
* A new row is added on the table and the user can enter the new break
|
|
|
|
* data. After that he can either press the save or cancel button.
|
|
|
|
*/
|
2021-11-06 19:38:37 +03:00
|
|
|
$('.add-break').on(
|
|
|
|
'click',
|
|
|
|
function () {
|
2022-01-11 12:52:58 +03:00
|
|
|
const timeFormat = App.Vars.time_format === 'regular' ? 'h:mm a' : 'HH:mm';
|
2021-11-06 19:38:37 +03:00
|
|
|
|
2022-01-11 12:52:58 +03:00
|
|
|
const $newBreak = $('<tr/>', {
|
2021-11-06 19:38:37 +03:00
|
|
|
'html': [
|
|
|
|
$('<td/>', {
|
|
|
|
'class': 'break-day editable',
|
2021-12-13 09:52:09 +03:00
|
|
|
'text': App.Lang.sunday
|
2021-11-06 19:38:37 +03:00
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'class': 'break-start editable',
|
2021-11-24 10:34:26 +03:00
|
|
|
'text': moment('12:00', 'HH:mm').format(timeFormat).toLowerCase()
|
2021-11-06 19:38:37 +03:00
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'class': 'break-end editable',
|
2021-11-24 10:34:26 +03:00
|
|
|
'text': moment('14:00', 'HH:mm').format(timeFormat).toLowerCase()
|
2021-11-06 19:38:37 +03:00
|
|
|
}),
|
|
|
|
$('<td/>', {
|
|
|
|
'html': [
|
|
|
|
$('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'btn btn-outline-secondary btn-sm edit-break',
|
2021-12-13 09:52:09 +03:00
|
|
|
'title': App.Lang.edit,
|
2021-11-06 19:38:37 +03:00
|
|
|
'html': [
|
|
|
|
$('<span/>', {
|
|
|
|
'class': 'fas fa-edit'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
$('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'btn btn-outline-secondary btn-sm delete-break',
|
2021-12-13 09:52:09 +03:00
|
|
|
'title': App.Lang.delete,
|
2021-11-06 19:38:37 +03:00
|
|
|
'html': [
|
|
|
|
$('<span/>', {
|
|
|
|
'class': 'fas fa-trash-alt'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
$('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'btn btn-outline-secondary btn-sm save-break d-none',
|
2021-12-13 09:52:09 +03:00
|
|
|
'title': App.Lang.save,
|
2021-11-06 19:38:37 +03:00
|
|
|
'html': [
|
|
|
|
$('<span/>', {
|
|
|
|
'class': 'fas fa-check-circle'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
$('<button/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'class': 'btn btn-outline-secondary btn-sm cancel-break d-none',
|
2021-12-13 09:52:09 +03:00
|
|
|
'title': App.Lang.cancel,
|
2021-11-06 19:38:37 +03:00
|
|
|
'html': [
|
|
|
|
$('<span/>', {
|
|
|
|
'class': 'fas fa-ban'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}).appendTo('.breaks tbody');
|
|
|
|
|
|
|
|
// Bind editable and event handlers.
|
|
|
|
this.editableDayCell($newBreak.find('.break-day'));
|
|
|
|
this.editableTimeCell($newBreak.find('.break-start, .break-end'));
|
|
|
|
$newBreak.find('.edit-break').trigger('click');
|
|
|
|
}.bind(this)
|
|
|
|
);
|
2016-04-24 20:28:33 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Edit Break Button "Click"
|
|
|
|
*
|
|
|
|
* Enables the row editing for the "Breaks" table rows.
|
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
$(document).on('click', '.edit-break', function () {
|
2020-05-12 21:52:32 +03:00
|
|
|
// Reset previous editable table cells.
|
2022-01-11 12:52:58 +03:00
|
|
|
const $previousEdits = $(this).closest('table').find('.editable');
|
2020-05-12 21:52:32 +03:00
|
|
|
|
|
|
|
$previousEdits.each(function (index, editable) {
|
2020-05-06 20:15:11 +03:00
|
|
|
if (editable.reset) {
|
2016-05-14 13:28:42 +03:00
|
|
|
editable.reset();
|
2016-04-24 20:28:33 +03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Make all cells in current row editable.
|
|
|
|
$(this).parent().parent().children().trigger('edit');
|
2021-11-06 19:38:37 +03:00
|
|
|
$(this)
|
|
|
|
.parent()
|
|
|
|
.parent()
|
|
|
|
.find('.break-start input, .break-end input')
|
|
|
|
.timepicker({
|
2021-12-18 23:36:25 +03:00
|
|
|
timeFormat: App.Vars.time_format === 'regular' ? 'h:mm tt' : 'HH:mm',
|
2021-12-13 09:52:09 +03:00
|
|
|
currentText: App.Lang.now,
|
|
|
|
closeText: App.Lang.close,
|
|
|
|
timeOnlyTitle: App.Lang.select_time,
|
|
|
|
timeText: App.Lang.time,
|
|
|
|
hourText: App.Lang.hour,
|
|
|
|
minuteText: App.Lang.minutes
|
2021-11-06 19:38:37 +03:00
|
|
|
});
|
2016-04-24 20:28:33 +03:00
|
|
|
$(this).parent().parent().find('.break-day select').focus();
|
|
|
|
|
|
|
|
// Show save - cancel buttons.
|
2022-01-11 12:52:58 +03:00
|
|
|
const $tr = $(this).closest('tr');
|
2020-06-09 17:36:54 +03:00
|
|
|
$tr.find('.edit-break, .delete-break').addClass('d-none');
|
|
|
|
$tr.find('.save-break, .cancel-break').removeClass('d-none');
|
2021-11-06 19:38:37 +03:00
|
|
|
$tr.find('select,input:text').addClass('form-control form-control-sm');
|
2013-12-20 19:44:44 +02:00
|
|
|
});
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* Event: Delete Break Button "Click"
|
|
|
|
*
|
|
|
|
* Removes the current line from the "Breaks" table.
|
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
$(document).on('click', '.delete-break', function () {
|
|
|
|
$(this).parent().parent().remove();
|
2016-04-24 20:28:33 +03:00
|
|
|
});
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* Event: Cancel Break Button "Click"
|
|
|
|
*
|
|
|
|
* Bring the ".breaks" table back to its initial state.
|
2016-05-14 13:28:42 +03:00
|
|
|
*
|
2020-10-20 16:03:48 +03:00
|
|
|
* @param {jQuery.Event} event
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
2021-11-06 19:38:37 +03:00
|
|
|
$(document).on(
|
|
|
|
'click',
|
|
|
|
'.cancel-break',
|
|
|
|
function (event) {
|
2022-01-11 12:52:58 +03:00
|
|
|
const element = event.target;
|
|
|
|
const $modifiedRow = $(element).closest('tr');
|
2021-11-06 19:38:37 +03:00
|
|
|
this.enableCancel = true;
|
|
|
|
$modifiedRow.find('.cancel-editable').trigger('click');
|
|
|
|
this.enableCancel = false;
|
|
|
|
|
|
|
|
$modifiedRow.find('.edit-break, .delete-break').removeClass('d-none');
|
|
|
|
$modifiedRow.find('.save-break, .cancel-break').addClass('d-none');
|
|
|
|
}.bind(this)
|
|
|
|
);
|
2016-04-24 20:28:33 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Save Break Button "Click"
|
|
|
|
*
|
|
|
|
* Save the editable values and restore the table to its initial state.
|
2016-05-14 13:28:42 +03:00
|
|
|
*
|
2021-11-24 10:34:26 +03:00
|
|
|
* @param {jQuery.Event} event
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
2021-11-06 19:38:37 +03:00
|
|
|
$(document).on(
|
|
|
|
'click',
|
|
|
|
'.save-break',
|
|
|
|
function (event) {
|
|
|
|
// Break's start time must always be prior to break's end.
|
2022-01-11 12:52:58 +03:00
|
|
|
const element = event.target;
|
2021-11-24 10:34:26 +03:00
|
|
|
|
2022-01-11 12:52:58 +03:00
|
|
|
const $modifiedRow = $(element).closest('tr');
|
2021-11-06 19:38:37 +03:00
|
|
|
|
2022-01-11 12:52:58 +03:00
|
|
|
const startMoment = moment($modifiedRow.find('.break-start input').val(), 'HH:mm');
|
2021-11-24 10:34:26 +03:00
|
|
|
|
2022-01-11 12:52:58 +03:00
|
|
|
const endMoment = moment($modifiedRow.find('.break-end input').val(), 'HH:mm');
|
2021-11-24 10:34:26 +03:00
|
|
|
|
|
|
|
if (startMoment.isAfter(endMoment)) {
|
2021-11-06 19:38:37 +03:00
|
|
|
$modifiedRow.find('.break-end input').val(
|
2021-11-24 10:34:26 +03:00
|
|
|
startMoment
|
|
|
|
.add(1, 'hour')
|
2021-12-18 23:36:25 +03:00
|
|
|
.format(App.Vars.time_format === 'regular' ? 'h:mm a' : 'HH:mm')
|
2021-11-06 19:38:37 +03:00
|
|
|
.toLowerCase()
|
|
|
|
);
|
|
|
|
}
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2021-11-06 19:38:37 +03:00
|
|
|
this.enableSubmit = true;
|
|
|
|
$modifiedRow.find('.editable .submit-editable').trigger('click');
|
|
|
|
this.enableSubmit = false;
|
2016-04-24 20:28:33 +03:00
|
|
|
|
2021-11-06 19:38:37 +03:00
|
|
|
$modifiedRow.find('.save-break, .cancel-break').addClass('d-none');
|
|
|
|
$modifiedRow.find('.edit-break, .delete-break').removeClass('d-none');
|
|
|
|
}.bind(this)
|
|
|
|
);
|
2018-04-12 16:03:46 +03:00
|
|
|
|
|
|
|
/**
|
2020-10-20 16:03:48 +03:00
|
|
|
* Event: Add Working Plan Exception Button "Click"
|
2018-04-12 16:03:46 +03:00
|
|
|
*
|
2020-10-20 16:03:48 +03:00
|
|
|
* A new row is added on the table and the user can enter the new working plan exception.
|
2018-04-12 16:03:46 +03:00
|
|
|
*/
|
2021-11-06 19:38:37 +03:00
|
|
|
$(document).on(
|
|
|
|
'click',
|
|
|
|
'.add-working-plan-exception',
|
|
|
|
function () {
|
2022-01-11 12:52:58 +03:00
|
|
|
App.Components.WorkingPlanExceptionsModal.add().done(
|
2021-11-06 19:38:37 +03:00
|
|
|
function (date, workingPlanException) {
|
2022-01-11 12:52:58 +03:00
|
|
|
const $tr = null;
|
2021-11-06 19:38:37 +03:00
|
|
|
|
|
|
|
$('.working-plan-exceptions tbody tr').each(function (index, tr) {
|
|
|
|
if (date === $(tr).data('date')) {
|
|
|
|
$tr = $(tr);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
2020-10-20 16:03:48 +03:00
|
|
|
|
2022-01-11 12:52:58 +03:00
|
|
|
let $newTr = this.renderWorkingPlanExceptionRow(date, workingPlanException);
|
2020-10-20 16:03:48 +03:00
|
|
|
|
2021-11-06 19:38:37 +03:00
|
|
|
if ($tr) {
|
|
|
|
$tr.replaceWith($newTr);
|
|
|
|
} else {
|
|
|
|
$newTr.appendTo('.working-plan-exceptions tbody');
|
|
|
|
}
|
|
|
|
}.bind(this)
|
|
|
|
);
|
|
|
|
}.bind(this)
|
|
|
|
);
|
2018-04-12 16:03:46 +03:00
|
|
|
|
|
|
|
/**
|
2020-10-20 16:03:48 +03:00
|
|
|
* Event: Edit working plan exception Button "Click"
|
2018-04-12 16:03:46 +03:00
|
|
|
*
|
2020-10-20 16:03:48 +03:00
|
|
|
* Enables the row editing for the "working plan exception" table rows.
|
2018-04-12 16:03:46 +03:00
|
|
|
*
|
2020-10-20 16:03:48 +03:00
|
|
|
* @param {jQuery.Event} event
|
2018-04-12 16:03:46 +03:00
|
|
|
*/
|
2021-11-06 19:38:37 +03:00
|
|
|
$(document).on(
|
|
|
|
'click',
|
|
|
|
'.edit-working-plan-exception',
|
|
|
|
function (event) {
|
2022-01-11 12:52:58 +03:00
|
|
|
const $tr = $(event.target).closest('tr');
|
|
|
|
const date = $tr.data('date');
|
|
|
|
const workingPlanException = $tr.data('workingPlanException');
|
2021-11-06 19:38:37 +03:00
|
|
|
|
2022-01-11 12:52:58 +03:00
|
|
|
App.Components.WorkingPlanExceptionsModal.edit(date, workingPlanException).done(
|
2021-11-06 19:38:37 +03:00
|
|
|
function (date, workingPlanException) {
|
|
|
|
$tr.replaceWith(this.renderWorkingPlanExceptionRow(date, workingPlanException));
|
|
|
|
}.bind(this)
|
|
|
|
);
|
|
|
|
}.bind(this)
|
|
|
|
);
|
2018-04-12 16:03:46 +03:00
|
|
|
|
|
|
|
/**
|
2020-10-20 16:03:48 +03:00
|
|
|
* Event: Delete working plan exception Button "Click"
|
2018-04-12 16:03:46 +03:00
|
|
|
*
|
2020-10-20 16:03:48 +03:00
|
|
|
* Removes the current line from the "working plan exceptions" table.
|
2018-04-12 16:03:46 +03:00
|
|
|
*/
|
2020-10-20 16:03:48 +03:00
|
|
|
$(document).on('click', '.delete-working-plan-exception', function () {
|
|
|
|
$(this).closest('tr').remove();
|
|
|
|
});
|
2016-04-24 20:28:33 +03:00
|
|
|
};
|
2013-09-25 18:43:17 +03:00
|
|
|
|
|
|
|
/**
|
2016-04-24 20:28:33 +03:00
|
|
|
* Get the working plan settings.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @return {Object} Returns the working plan settings object.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.get = function () {
|
2022-01-11 12:52:58 +03:00
|
|
|
const workingPlan = {};
|
2020-10-20 16:03:48 +03:00
|
|
|
|
2021-11-06 19:38:37 +03:00
|
|
|
$('.working-plan input:checkbox').each(
|
|
|
|
function (index, checkbox) {
|
2022-01-11 12:52:58 +03:00
|
|
|
const id = $(checkbox).attr('id');
|
2021-11-06 19:38:37 +03:00
|
|
|
if ($(checkbox).prop('checked') === true) {
|
|
|
|
workingPlan[id] = {
|
2021-11-24 10:34:26 +03:00
|
|
|
start: moment($('#' + id + '-start').val(), 'HH:mm').format('HH:mm'),
|
|
|
|
end: moment($('#' + id + '-end').val(), 'HH:mm').format('HH:mm'),
|
2021-11-06 19:38:37 +03:00
|
|
|
breaks: []
|
|
|
|
};
|
|
|
|
|
|
|
|
$('.breaks tr').each(
|
|
|
|
function (index, tr) {
|
2022-01-11 12:52:58 +03:00
|
|
|
const day = this.convertDayToValue($(tr).find('.break-day').text());
|
2021-11-06 19:38:37 +03:00
|
|
|
|
|
|
|
if (day === id) {
|
2022-01-11 12:52:58 +03:00
|
|
|
const start = $(tr).find('.break-start').text();
|
|
|
|
const end = $(tr).find('.break-end').text();
|
2021-11-06 19:38:37 +03:00
|
|
|
|
|
|
|
workingPlan[id].breaks.push({
|
2021-11-24 10:34:26 +03:00
|
|
|
start: moment(
|
|
|
|
start,
|
2021-12-18 23:36:25 +03:00
|
|
|
App.Vars.time_format === 'regular' ? 'h:mm a' : 'HH:mm'
|
2021-11-24 10:34:26 +03:00
|
|
|
).format('HH:mm'),
|
2021-12-18 23:36:25 +03:00
|
|
|
end: moment(end, App.Vars.time_format === 'regular' ? 'h:mm a' : 'HH:mm').format(
|
|
|
|
'HH:mm'
|
|
|
|
)
|
2021-11-06 19:38:37 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}.bind(this)
|
|
|
|
);
|
2019-06-08 17:48:24 +03:00
|
|
|
|
2021-11-06 19:38:37 +03:00
|
|
|
// Sort breaks increasingly by hour within day
|
|
|
|
workingPlan[id].breaks.sort(function (break1, break2) {
|
|
|
|
// We can do a direct string comparison since we have time based on 24 hours clock.
|
|
|
|
return break1.start.localeCompare(break2.start);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
workingPlan[id] = null;
|
|
|
|
}
|
|
|
|
}.bind(this)
|
|
|
|
);
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
return workingPlan;
|
|
|
|
};
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2018-04-12 16:03:46 +03:00
|
|
|
/**
|
2020-10-20 16:03:48 +03:00
|
|
|
* Get the working plan exceptions settings.
|
2018-04-12 16:03:46 +03:00
|
|
|
*
|
2020-10-20 16:03:48 +03:00
|
|
|
* @return {Object} Returns the working plan exceptions settings object.
|
2018-04-12 16:03:46 +03:00
|
|
|
*/
|
2020-10-20 16:03:48 +03:00
|
|
|
WorkingPlan.prototype.getWorkingPlanExceptions = function () {
|
2022-01-11 12:52:58 +03:00
|
|
|
const workingPlanExceptions = {};
|
2018-04-12 16:03:46 +03:00
|
|
|
|
2020-10-20 16:03:48 +03:00
|
|
|
$('.working-plan-exceptions tbody tr').each(function (index, tr) {
|
2022-01-11 12:52:58 +03:00
|
|
|
const $tr = $(tr);
|
|
|
|
const date = $tr.data('date');
|
2020-10-20 16:03:48 +03:00
|
|
|
workingPlanExceptions[date] = $tr.data('workingPlanException');
|
|
|
|
});
|
2018-04-12 16:03:46 +03:00
|
|
|
|
2020-10-20 16:03:48 +03:00
|
|
|
return workingPlanExceptions;
|
2018-04-12 16:03:46 +03:00
|
|
|
};
|
|
|
|
|
2013-09-25 18:43:17 +03:00
|
|
|
/**
|
2016-05-14 13:28:42 +03:00
|
|
|
* Enables or disables the timepicker functionality from the working plan input text fields.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2020-05-06 20:15:11 +03:00
|
|
|
* @param {Boolean} [disabled] If true then the timepickers will be disabled.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.timepickers = function (disabled) {
|
2016-04-24 20:28:33 +03:00
|
|
|
disabled = disabled || false;
|
|
|
|
|
2020-05-06 20:15:11 +03:00
|
|
|
if (disabled === false) {
|
2016-04-24 20:28:33 +03:00
|
|
|
// Set timepickers where needed.
|
2017-09-23 04:42:14 +03:00
|
|
|
$('.working-plan input:text').timepicker({
|
2021-12-18 23:36:25 +03:00
|
|
|
timeFormat: App.Vars.time_format === 'regular' ? 'h:mm tt' : 'HH:mm',
|
2021-12-13 09:52:09 +03:00
|
|
|
currentText: App.Lang.now,
|
|
|
|
closeText: App.Lang.close,
|
|
|
|
timeOnlyTitle: App.Lang.select_time,
|
|
|
|
timeText: App.Lang.time,
|
|
|
|
hourText: App.Lang.hour,
|
|
|
|
minuteText: App.Lang.minutes,
|
2016-04-24 20:28:33 +03:00
|
|
|
|
2018-01-23 12:08:37 +03:00
|
|
|
onSelect: function (datetime, inst) {
|
2016-04-24 20:28:33 +03:00
|
|
|
// Start time must be earlier than end time.
|
2022-01-11 12:52:58 +03:00
|
|
|
const startMoment = moment($(this).parent().parent().find('.work-start').val(), 'HH:mm');
|
2021-11-24 10:34:26 +03:00
|
|
|
|
2022-01-11 12:52:58 +03:00
|
|
|
const endMoment = moment($(this).parent().parent().find('.work-end').val(), 'HH:mm');
|
2016-04-24 20:28:33 +03:00
|
|
|
|
2021-11-24 10:34:26 +03:00
|
|
|
if (startMoment > endMoment) {
|
2021-11-06 19:38:37 +03:00
|
|
|
$(this)
|
|
|
|
.parent()
|
|
|
|
.parent()
|
|
|
|
.find('.work-end')
|
|
|
|
.val(
|
2021-11-24 10:34:26 +03:00
|
|
|
startMoment
|
|
|
|
.add(1, 'hour')
|
2021-12-18 23:36:25 +03:00
|
|
|
.format(App.Vars.time_format === 'regular' ? 'h:mm a' : 'HH:mm')
|
2021-11-06 19:38:37 +03:00
|
|
|
.toLowerCase()
|
|
|
|
);
|
2016-04-24 20:28:33 +03:00
|
|
|
}
|
2013-09-25 18:43:17 +03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
2016-04-24 20:28:33 +03:00
|
|
|
$('.working-plan input').timepicker('destroy');
|
2013-09-25 18:43:17 +03:00
|
|
|
}
|
2016-04-24 20:28:33 +03:00
|
|
|
};
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* Reset the current plan back to the company's default working plan.
|
|
|
|
*/
|
2021-11-06 19:38:37 +03:00
|
|
|
WorkingPlan.prototype.reset = function () {};
|
2013-10-17 18:31:43 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* This is necessary for translated days.
|
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @param {String} value Day value could be like "monday", "tuesday" etc.
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.convertValueToDay = function (value) {
|
2016-04-24 20:28:33 +03:00
|
|
|
switch (value) {
|
2017-11-16 01:19:17 +03:00
|
|
|
case 'sunday':
|
2021-12-13 09:52:09 +03:00
|
|
|
return App.Lang.sunday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'monday':
|
2021-12-13 09:52:09 +03:00
|
|
|
return App.Lang.monday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'tuesday':
|
2021-12-13 09:52:09 +03:00
|
|
|
return App.Lang.tuesday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'wednesday':
|
2021-12-13 09:52:09 +03:00
|
|
|
return App.Lang.wednesday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'thursday':
|
2021-12-13 09:52:09 +03:00
|
|
|
return App.Lang.thursday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'friday':
|
2021-12-13 09:52:09 +03:00
|
|
|
return App.Lang.friday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'saturday':
|
2021-12-13 09:52:09 +03:00
|
|
|
return App.Lang.saturday;
|
2016-04-24 20:28:33 +03:00
|
|
|
}
|
|
|
|
};
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* This is necessary for translated days.
|
|
|
|
*
|
2020-09-07 10:53:39 +03:00
|
|
|
* @param {String} day Day value could be like "Monday", "Tuesday" etc.
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.convertDayToValue = function (day) {
|
2016-04-24 20:28:33 +03:00
|
|
|
switch (day) {
|
2021-12-13 09:52:09 +03:00
|
|
|
case App.Lang.sunday:
|
2017-11-16 01:19:17 +03:00
|
|
|
return 'sunday';
|
2021-12-13 09:52:09 +03:00
|
|
|
case App.Lang.monday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'monday';
|
2021-12-13 09:52:09 +03:00
|
|
|
case App.Lang.tuesday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'tuesday';
|
2021-12-13 09:52:09 +03:00
|
|
|
case App.Lang.wednesday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'wednesday';
|
2021-12-13 09:52:09 +03:00
|
|
|
case App.Lang.thursday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'thursday';
|
2021-12-13 09:52:09 +03:00
|
|
|
case App.Lang.friday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'friday';
|
2021-12-13 09:52:09 +03:00
|
|
|
case App.Lang.saturday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'saturday';
|
|
|
|
}
|
|
|
|
};
|
2013-12-20 13:12:36 +02:00
|
|
|
|
2022-01-11 12:52:58 +03:00
|
|
|
return WorkingPlan;
|
2016-10-23 22:52:36 +03:00
|
|
|
})();
|