How can I get the current quarter we are in with javascript? I am trying to detect what quarter we are currently in, e.g. 2.
EDIT And how can I coun
It's not efficient or readable but it's in oneliner flavour.
(new Date(new Date().getFullYear(), Math.floor((new Date().getMonth() + 3) / 3) * 3, 1) - new Date()) / 86400000