Skip to content
Discussion options

You must be logged in to vote

Hello @AB1908 After some time the customjs plugin eventually worked. It took a while for me to realize it works since development using customjs and also views scripts require a lot of restart to obsidian. Adding my code here in case anyone comes across this topic.

Basically, I moved all my functions into a class named DataviewUtils. Like this

class DataviewUtils {
  getLastWeekDay(currentDateString) {
    const currentDate = new Date(currentDateString);
    const currentDayOfWeek = currentDate.getDay();

    const daysToGoBack =
      currentDayOfWeek === 1 ? 3 : currentDayOfWeek === 0 ? 2 : 1;
    const lastWeekDay = new Date(
      currentDate.getTime() - daysToGoBack * 24 * 60 * 60 * 1…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@dgokcin
Comment options

@dgokcin
Comment options

@AB1908
Comment options

@dgokcin
Comment options

Answer selected by AB1908
@gasperphoenix
Comment options

@dgokcin
Comment options

@gasperphoenix
Comment options

@gasperphoenix
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants