Skip to content

Commit

Permalink
Dynamic year
Browse files Browse the repository at this point in the history
  • Loading branch information
w35l3y authored Dec 30, 2024
1 parent 449b1f4 commit ecd4020
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ const enhance11tydata = (

// TODO: do we need to use the locale? it defaults to gregorian calendar,
// which is probably wrong in many cases. or is it "normal" by now?
obj.currentYear = new Date().getFullYear().toString(10);
Object.defineProperty(obj, "currentYear", {
get () {
return new Date().getFullYear().toString(10);
}
});

return obj;
};
Expand Down

0 comments on commit ecd4020

Please sign in to comment.