CosmoQuestX/Rocket-Bot

New command: !kerbals

Opened this issue · 1 comments

!kerbals <number of days|months|years>|<date>

Returns the number of kerbal equivalent to the number of days/months/years or since/until the date.

Considerations: Needs to calculate the value of a kerbal each time as it is a continuously changing constant.

Comments

  • 1 Mean Gregorian Calendar Year === (365+1/4-1/100+1/400) days === 365.2425 days [1]

  • Months would mess this thing up, since they are not as cleanly calculated. I'll see if there are any pre-made packages/scripts that do this for me. Though if it comes to it, I may be able to come up with my own system.

Code Examples

const yr = (new Date()).getFullYear();
(yr % 4 === 0) && (yr % 100 !== 0) || (yr % 400 === 0); // is Leap Year