Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
9093 มุมมอง

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 15
4064
3
มี.ค. 15
10973
1
ก.พ. 23
7771
0
มี.ค. 15
8260
1
มี.ค. 15
7854