formkit / tempo

📆 Parse, format, manipulate, and internationalize dates and times in JavaScript and TypeScript.
https://tempo.formkit.com
MIT License
2.34k stars 30 forks source link

adding difference in months & year (stacked on difference constant functions PR) #51

Closed WilcoSp closed 5 months ago

WilcoSp commented 5 months ago

this PR will close issue https://github.com/formkit/tempo/issues/45 this PR is stacked on top of PR https://github.com/formkit/tempo/pull/50

this PR in specific adds differenceInMonths & differenceInYears on top of the additions from https://github.com/formkit/tempo/pull/50

if there is any feedback/suggestions let me know.

vercel[bot] commented 5 months ago

@WilcoSp is attempting to deploy a commit to the Formkit Team on Vercel.

A member of the Team first needs to authorize it.

justin-schroeder commented 5 months ago

Honestly I really like everything you’ve done here. This is great work @WilcoSp! My only quibble — I dont love the long function names. I know they match datefns, which is a positive, but the general naming of functions in tempo are small and terse. This isn’t super important to me, but what would you think of:

WilcoSp commented 5 months ago

hey no issue @justin-schroeder, I like the shorter names as gives a bit cleaner code & less prone to typos. I'll change the names when I've some time.

WilcoSp commented 5 months ago

All the function names have been shortened

justin-schroeder commented 5 months ago

Thanks @WilcoSp!