vigoren / foundryvtt-simple-calendar

A simple calendar module for the FoundryVTT system
https://simplecalendar.info/
MIT License
48 stars 35 forks source link

[QUESTION] Counting seasons (or season changes) from a date to today #593

Open Forien opened 6 months ago

Forien commented 6 months ago

Hi, I was wondering if there is a working API call or function that would allow me to get amount of seasons between two dates (or between a past date and today).

Main reason is for use in macro for WFRP4e, where potions can get spoilage effects based on how many seasons old they are.

Theoretically it could just count how many times a new season started, so a Winter -> Spring, would count as 1, regardless of when inside the seasons dates are exactly, but if it counted precisely it wouldn't be the end of the world.

If there is no ready to use functions, is it something that would be relatively easy to do myself using the API?