The tm_wday
(e.g., weekday) property on the C++ time structure struct tm
represents days since Sunday, an integer from 0-6. This is often used in daylight savings calculations; e.g., "The first Sunday in November."
http://www.cplusplus.com/reference/ctime/tm/
How is the equivalent calculated in JavaScript? In other words, how can "Days since Sunday" be found using a JavaScript Date()
object?
I Googled around, and checked the MDN docs, but there does not appear to be an equivalent method.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
Is anyone aware of a polyfill or get_days_since_sunday()
method that has been written? Is there an easy way to do this, or do I need to write it? Thx, Keith :^)