lyonsquark / obsidian-daf-yomi

Prepare Daf Yomi notes for Obsidian
MIT License
7 stars 1 forks source link

Incorrect dates for Living Greengrass link #22

Closed lyonsquark closed 1 year ago

lyonsquark commented 1 year ago

The Living Greengrass blog link need the date of the daf. I'm getting the wrong dates and so the link doesn't work.


This happens because of https://github.com/lyonsquark/obsidian-daf-yomi/blob/b0b4390ef71dde10f619b8b52943d818709d7378/main.ts#L306

That alters the original object, so that subsequent calls to the dateForDafForLGG function return the wrong answer.

The solution is to do

let dafDate = daf.startDate.clone().add(inPage-1, 'days');

The clone() will copy the object so the subsequent add will not alter the original.