longbill / jquery-date-range-picker

A jQuery plugin that allows user to select a date range
MIT License
1.12k stars 579 forks source link

monthSelect conflict with customShortcuts #384

Closed garshyn closed 7 months ago

garshyn commented 6 years ago

Trying to implement custom shortcuts.

It produces undefined when enabling monthSelect

https://jsfiddle.net/k0aLykkc/1/

Pascal76 commented 7 months ago

Can this help you ?

        {
            name: 'this week',
            dates : function()
            {                   
                var start = DateTime.now().startOf('week').toJSDate();
                if (DateTime.now().toFormat("WW") === DateTime.now().minus({ day: 1 }).toFormat("WW"))
                      end = DateTime.now().minus({ day: 1 }).toJSDate();
                 else end = DateTime.now().toJSDate();
                return [start,end];
            }
        },