How to get the current day of the week using dataviewjs?
I don’t know much about javascript, much less about how to work with dates in js.
My first strategy is “using some dataview functions” - dv.func
:
dv.span(dv.func.dateformat(dv.date('today'), 'WW'))
Or exploring moment.js
:
dv.span(moment(Date.now()).format('WW'))
2 Likes
I think is not correct, actually it print 43
what’s the output of this inline query?
`=dateformat(date(today), "WW")`
i have found an alternative method to have the day of week: using templater:
<% tp.date.now(“dddd”) %>
So i solved the problem, thanks anyway for the help.
The number is correct. The issue is related with the differences between iso/luxon and locale version:
1 Like
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.