I came across this helpful gist with date extensions: https://gist.github.com/weslleih/b6e7628416a052963349494747aed659
However, when attempting to use the functions, I encountered a runtime error stating:
TypeError: x.isToday is not a function
I found a workaround by importing the extensions into the file where they are used, like this:
import 'src/date.extensions';
This solution seems a bit hacky. How can we ensure that others know to import these extensions in order for the date extension methods to work?
Does anyone have a more elegant solution?
(or perhaps this is the wrong approach. I'm more familiar with C# where method extensions are common)