Skip to main content Skip to footer

Convert Calendar Year to Fiscal Year with Wijmo's Globalize Class

Wijmo's Globalize class allows developers to express dates in relation to its fiscal year, providing an easy, convenient, error-free method of converting calendar dates to fiscal quarters. A fiscal year (or financial year) is a period used for calculating annual financial statements in businesses and other organizations all over the world. In many jurisdictions, regulatory laws regarding accounting and taxation require such reports once per twelve months, but do not require that the period reported on constitutes a calendar year (that is, 1 January to 31 December). Many applications require formatting dates according to the fiscal rather than calendar year. This can be done by adding or subtracting a culture-specific number of months to the calendar date, and using the result in the application. Wijmo’s Globalize class makes this conversion easy and convenient by supporting date format specifiers for fiscal year and quarter. In addition to the standard (.NET-style) custom date strings, Globalize supports the following:

Format String

Description

Q, q

Calendar quarter

U

Fiscal quarter (government)

U

Fiscal quarter (private sector)

EEEE, EEE, EE, E

Fiscal year (government)

eeee, eee, ee, e

Fiscal year (private sector)

For example, this code:

var d = new Date(2015, 9, 1); // Oct 1, 2015  
console.log('short date format: ' + wijmo.Globalize.format(d, 'd'));  
console.log('year/quarter, calendar year: ' + wijmo.Globalize.format(d, 'yyyy" Q"Q'));  
console.log('year/quarter, fiscal year: ' + wijmo.Globalize.format(d, '"FY "EEEE" Q"U'));

Generates this output: short date format: 10/1/2015 year/quarter, calendar year: 2015 Q4 year/quarter, fiscal year: FY 2016 Q1 Wijmo’s default culture is English/United States. In the United States, fiscal year 2016 runs from October 1, 2015 to September 30, 2016. Therefore, the date used in the example above, October 1st 2015 is the first month (and first quarter) of fiscal year 2016. Adding fiscal year support to the Globalize class means it is automatically available in all Wijmo controls, including for example the FlexGrid and FlexChart. It also makes this feature available to applications, eliminating the need for extra conversion steps that can be tedious and error-prone. Expanded in version 5.20153.108

MESCIUS inc.

comments powered by Disqus