Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

FiscalCalendar Question

$
0
0
I wonder if you can tell me whether you think there's a problem with implementation of the FiscalCalendar.

To initialize it we provide start dates for each fiscal year. I would expect the end date to be the (start date of next year - 1 day), but it actually appears to be (start date of fiscal year + 1 year), or something similar. The result is that the DateChooser returns the wrong week for days that overlap.

Here's an example:

The contents of the table that defines our fiscal years returns the data shown in the FiscalCalendar.png attachment This is used to initialize the FiscalCalendar object.

From this I would expect the end date for fiscal year 2013 to be 2013-09-14.

However, when I interrogate the FiscalCalendar object that we initialize from this list I get the following for the years 2013 and 2014:

2013
DateUtil.getFiscalCalendar().getFiscalYears()[1].getAttribute("startDate") ---returns ---> Sun Sep 16 2012 00:00:00 GMT-0700 (US Mountain Standard Time)
DateUtil.getFiscalCalendar().getFiscalYears()[1].getAttribute("endDate") ---returns ---> Tue Sep 17 2013 23:59:59 GMT-0700 (US Mountain Standard Time)

2014
DateUtil.getFiscalCalendar().getFiscalYears()[2].getAttribute("startDate") ---returns ---> Sun Sep 15 2013 00:00:00 GMT-0700 (US Mountain Standard Time)
DateUtil.getFiscalCalendar().getFiscalYears()[2].getAttribute("endDate") ---returns ---> Wed Sep 17 2014 23:59:59 GMT-0700 (US Mountain Standard Time)

You can see that the end date for fiscal year 2013 is 2013-09-17, yet the start date for 2014 is 2013-09-15.

The problem this causes is that 2013-09-15 through 2013-09-17 are returned by DateUtil.getFiscalWeek() as being [2013]53 instead of [2014]01. This in turn means that the DateChooser component returns 201353 for those dates instead of 201401. See the attached DateChooser.png image - this shows that those dates are represented as being in Week 1 of 2014, but you can see that the value returned to the "Sell To" field in the grid is 201353.

Is that a bug, or is there a problem with the way in which I am anticipating this ought to work? I think the former but am open to your thoughts.

Thanks,
Gary O'Donnell

Attached Images
File Type: png FiscalCalendar.png (20.4 KB)
File Type: png DateChooser.png (10.7 KB)

Viewing all articles
Browse latest Browse all 4756

Trending Articles