Page 1 of 1

[INFO REQ] Scheduler: Tertial date formatting in stead of Quartiles?

Posted: Mon Apr 17, 2023 10:34 pm
by lxxrxns

Hi there,

Is it possible to have a Scheduler view that shows Tertials (i.e. T1 = jan-apr, T2 = may-aug and T3 = sept-dec) in stead of Quartiles (Q1, Q2, Q3, Q4) for every year?

Thanks in advance,

Laurens


Re: [INFO REQ] Scheduler: Tertial date formatting in stead of Quartiles?

Posted: Tue Apr 18, 2023 9:19 am
by mats

Yes sure, you can create any configuration you want. I just built a demo showing this, is this what you had in mind?

viewPreset : {
                displayDateFormat : 'H:mm',
                shiftIncrement    : 1,
                shiftUnit         : 'WEEK',
                timeResolution    : {
                    unit      : 'MINUTE',
                    increment : 10
                },
                headers : [
                    {
                        unit       : 'year',
                        dateFormat : 'YYYY'
                    },
                    {
                        unit      : 'month',
                        increment : 4,
                        renderer(start, end) {
                            return `${DateHelper.format(start, 'MMM')} - ${DateHelper.format(DateHelper.add(end,  -1, 'month'), 'MMM')}`;
                        }
                    },
                    {
                        unit       : 'month',
                        dateFormat : 'MMM'
                    }
                ]
            },

Re: [INFO REQ] Scheduler: Tertial date formatting in stead of Quartiles?

Posted: Tue May 09, 2023 8:18 pm
by lxxrxns

Hi mats,

Yes, thank you, that's amazing!
And I was able to get the "T1, T2, T3" formatting by changing this part of your code to:

...
renderer(start) {
    return `T${Math.ceil(DateHelper.format(start, 'M')/4)}`;
}
...

Thank you so much!


Re: [INFO REQ] Scheduler: Tertial date formatting in stead of Quartiles?

Posted: Tue May 09, 2023 8:58 pm
by marcio

Hey lxxrxns,

Thanks for sharing your configuration! It'll help others in the future for sure. :)