Skip to content

Instantly share code, notes, and snippets.

View quitefounder's full-sized avatar

DIPIN KRISHNAN quitefounder

View GitHub Profile
@quitefounder
quitefounder / getFy.js
Created October 21, 2019 15:58
A javascript method using momentjs to get determine the current financial year.
let fy = getFinancialYear();
$('#displayFy').text('Financial year is: ' + fy);
$( "input#datePicker" ).change(function() {
fy = getFinancialYear($(this).val());
$('#displayFy').text('Financial year is: ' + fy);
});
function getFinancialYear(date) {
let financialYear;
let today = moment();