콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
9149 화면

When creating a leave request in calendar view by clicking or dragging, how can I influence the exact datetime (hour, minute) of the start and end date?

UPDATE:

I have located the code where the hours for date_start and date_stop for new records in calendar view are set:

web_calendar/static/src/js/calendar.js:

slow_create: function(event_id, event_obj) {
    var self = this;
    if (this.current_mode() === 'month') {
        event_obj['start_date'].addHours(8);
        if (event_obj._length === 1) {
            event_obj['end_date'] = new Date(event_obj['start_date']);
            event_obj['end_date'].addHours(1);
        } else {
            event_obj['end_date'].addHours(-4);
        }
    }
[....]

I guess I could modify the code, BUT: this would affect all calendar views. (I'm only interessted in changing the time for leave requests)...

Anyway: How can I access the employee object for a given leave request in JavaScript?

Could default values for hr_holiadys help?

Any help is appreciated.
Thanks.

아바타
취소
베스트 답변

I change:

event_obj['start_date'].addHours(8)

With:

event_obj['start_date'].addHours(7)

Now when I create a new request default time it 7AM.

아바타
취소
관련 게시물 답글 화면 활동
0
4월 15
4138
3
3월 15
11069
1
2월 23
7800
0
3월 15
8316
1
3월 15
7914