Skip to content

Instantly share code, notes, and snippets.

View connect-dips's full-sized avatar

DIPIN KUMAR KRISHNAN connect-dips

  • Chennai, Tamil Nadu, Kerala
View GitHub Profile
@connect-dips
connect-dips / 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();