How to fix Date range in Week View

The date header block range in the Week View shows a correct Start date, but the End date is 1-day too long.

I tried:
scheduler.templates.week_date = function( start, end ){ var formatFunc = scheduler.date.date_to_str( '%M. %j, %Y' ); return formatFunc( start ) + ' to ' + formatFunc( scheduler.date.subtract(end,1,"day") ); };
but it does not work.

See screen shot

How can I fix the bug in the Week View that shows the wrong ending date in the range?


This does not work either:
scheduler.templates.week_date = function( start, end ){ var formatFunc = scheduler.date.date_to_str( '%M. %j, %Y' ); var fixEnd = scheduler.date.subtract( end, 1, 'day'); return formatFunc( start ) + ' to ' + formatFunc( fixEnd ); };

SOLVED IT.

The documentation is what threw me…because the doc says you can “add/subtract” so I interpreted that to mean:
scheduler.date.add( end, 1, ‘day’)
or
scheduler.date.subtract( end, 1, ‘day’)

Anyway, this fixed the bug:
scheduler.templates.week_date = function( start, end ){ var formatFunc = scheduler.date.date_to_str( '%M. %j, %Y' ); var fixEnd = scheduler.date.add( end, -1, 'day'); return formatFunc( start ) + ' to ' + formatFunc( fixEnd ); };