Get the current quarter of a date
JavaScript version
const getQuarter = (d = new Date()) => Math.ceil((d.getMonth() + 1) / 3);
TypeScript version
const getQuarter = (d = new Date()): number => Math.ceil((d.getMonth() + 1) / 3);
JavaScript version
const getQuarter = (d = new Date()) => Math.ceil((d.getMonth() + 1) / 3);
TypeScript version
const getQuarter = (d = new Date()): number => Math.ceil((d.getMonth() + 1) / 3);