Skip to content

Commit

Permalink
feat: automatic year in catch log entry(LAN-44 ) (#227)
Browse files Browse the repository at this point in the history
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
  • Loading branch information
diePuppe and barredterra authored Jul 18, 2023
1 parent a6bf6b5 commit 9769ff0
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,12 @@ frappe.ui.form.on("Catch Log Entry", {
});
});
}
const today = new Date();
const current_year = today.getFullYear();
const current_month = today.getMonth();

if (!frm.doc.year) {
frm.set_value("year", current_month < 6 ? current_year - 1 : current_year);
}
},
});

0 comments on commit 9769ff0

Please sign in to comment.