Discuss anything related to web development but no technical support questions


Post by maxonchik »

I have a preset:
Sch.PresetManager.registerPreset('dayPreset', {
            timeColumnWidth : 40,
            displayDateFormat : 'G:i',
            shiftIncrement : 1,
            shiftUnit : Date.DAY,
            timeResolution : {
                unit : Date.MINUTE, 
                increment : 15
            },
            defaultSpan : 12,
            headerConfig : {
                bottom : {
                    unit : Date.HOUR,
                    dateFormat : 'g A'
                },
                middle : {
                    unit : Date.DAY,
                    dateFormat : 'D m/d'
                }
	        }
	    });
I'm changing preset using following code:
								start = today;

		                        start.clearTime();
		                        start.setHours(7);
		                       
		                        g.switchViewPreset('dayPreset', start, start.add(Date.HOUR, 24));
After the change timeline start from 12am (midnight) instead of 7am. Everything is fine when I use dayAndHour built in preset

Post by mats »

This is since your middle header is the 'main' one, it is 'DAY' so it will round your dates to a whole day. Your middle header should be hours if you want hour resolution.

Post Reply