-
• #2
P.S: I'm not saying the function should no longer accept Date objects: that would break previous implementations. Instead, it would accept both Date and integer arguments.
-
• #3
I just spotted your neat hack of
require('locale').dow({getDay:()=>i})
that's a good solution for now.But yes, we could definitely extend it - the only issue is it needs extending in firmware and the
locale
app
I'm developing an app which needs a list of the days of the week, but right now the
require("locale").dow()
function only accepts a Date object. So I've had to do this:It seems to me it would be more efficient if the dow() function could accept an integer as well (0 = Sunday, 6 = Saturday) because right now it's just calling
getDay()
on the argument. That way, the code would be simpler:Does this make sense?