Weekly notes review – show specific notes only

What I’m trying to do

i’m creating a note template for weekly notes where i want to list the books and articles i read in said week.

Things I have tried

first, i tried to get this information by way of using the creation date of my literature note. this worked just fine:

```dataview
LIST
WHERE econtains(type, "literature")
WHERE date(file.cdate).year = date(this.file.cday).year
WHERE date(file.cdate).weekyear = date(this.file.cday).weekyear
```

but there’s a missmatch of the creation date of the note and the day i read the book/article, therefore i added another parameter to the front matter:


reading-date: 30-08-2022

now, i don’t now how to make the dataview search work with this adaption. that’s why i’m reaching out to the community. may i ask you to be patient as i’m new to obsidian and not familiar with JS.

Topic

Summary
  • How to transform the value of reading-date into yyyy-MM-dd?

Test

Summary
  • dataview: v0.5.46

Input

Summary

the current note

  • filename : 20220921_Q15_DQL10
  • this.file.cday = date(“2022-09-21”)
### DQL10



dictionary files

  • Location: “100_Project/02_dataview/Q15_Reading/Q15_test_data”

03

  • filename : dic_19960301
---
Date: 1996-03-01
type: literature
reading-date: 31-03-2022
date_format : dd-MM-yyyy
---



04

  • filename : dic_19960401
---
Date: 1996-04-01
type: literature
reading-date: 20-09-2022
date_format : dd-MM-yyyy
---



05

  • filename : dic_19960501
---
Date: 1996-05-01
type: literature
reading-date: 21-09-2022
date_format : dd-MM-yyyy
---



06_wrong_month

  • filename : dic_19960601
---
Date: 1996-06-01
type: literature
reading-date: 30-76-2022
date_format : dd-MM-yyyy
---




DQL10_transform_reading-date_into_yyyy-MM-dd

Summary

Main DQL

Code Name Data type Group By Purposes Remark
DQL10_transform_reading-date_into_yyyy-MM-dd reading-date:
a string like dd-MM-yyyy
no 1.To filter by reading-date
2.To define a field variable s_rDate by using FLATTEN
3.To transform the value of reading-date into yyyy-MM-dd
4.To filter by date(s_rDate)
5.To display the result as a table
ONLY for reading-date field where the value is like dd-MM-yyyy

Code DQL10_transform_reading-date_into_yyyy-MM-dd

Summary_code
title: DQL10_transform_reading-date_into_yyyy-MM-dd =>ONLY for `reading-date` field where the value is like dd-MM-yyyy 1.To filter by `reading-date` 2.To define a field variable `s_rDate` by using `FLATTEN` 3.To transform the value of `reading-date` into yyyy-MM-dd 4.To filter by `date(s_rDate)` 5.To display the result as a table
collapse: close
icon: 
color: 
```dataview
TABLE WITHOUT ID
      file.link AS "File",
      s_rDate AS "s_rDate",
      date(this.file.cday).weekyear AS "this_weekyear",
      date(s_rDate).weekyear AS "weekyear"
FROM "100_Project/02_dataview/Q15_Reading/Q15_test_data"
WHERE econtains(type, "literature")
WHERE reading-date != null
FLATTEN regexreplace(reading-date, "^(\d{2})-(\d{2})-(\d{4})$", "$3-$2-$1") AS s_rDate
WHERE date(s_rDate) != null
WHERE date(s_rDate).year = this.file.cday.year
WHERE date(s_rDate).weekyear = this.file.cday.weekyear

```

Screenshots(DQL10)