Open martinshhh opened 6 years ago
Well, this is weird. I have the exactly opposite issue.
On my machine (running nodeJs version 8.10) I get running moment().modifyHolidays.set('Germany/RP')
my desired holidays set. Though it doesn't seem to this on my server (an Azure function to be precise). Even though both are running a node Js server at the same version (8.10).
The problem is a bug when using moment-holiday on windows.
The failure of the set
method occurs internally when calling the getLocale
function. On Mac (like my dev laptop) and Linux (like your AWS server) this will not fail. Unfortunately due to the used backslashes in node for windows, this will fail since in this case the __dirname
is not split at all.
Unfortunately no error is thrown since there is no catch block to catch an exception.... I'll create a pull request in the next hour in order to fix this.
On client side when I call moment.modifyHolidays.set('Canada') and then log it with moment().holidays() it returns the default locale (us). This only works server side. Is it possible to get it to work on client side?