Moon Calendar

I would like to add in my daily notes the current moon phase in my location. I searched but I didnt find any plugin for that.
What I did was to copy manually all the moons phases for 2024 and made a script for that. It took some time and effort, so I decided to suggest this plugin.
So anyone interested in making this plugin, I will be so grateful.

For those who want something similar, I will share how I did my manual moon phase. (I am from Brazil, so there are some parts in the code that are in portuguese)
The script:
"function getMoonPhase(date) {
var moonPhases = {
“2024-01-01”: “Terceiro dia após a Lua Cheia - Virgem.”,
“2024-01-02”: “Dois dias antes da Lua Minguante - Libra.”,
…};
return moonPhases[date];
}

module.exports = getMoonPhase;"

And I use this script in templater, I call this script like this: “<% tp.user.fase_lunar(tp.date.now(“YYYY-MM-DD”, 0, tp.file.title, “DD [de] MMMM [de] YYYY - dddd”)) %>”
(fase_lunar.js is the name of the file on my Script folder)

Thanks for the attention, and hoping someone develops this plugin :slight_smile:

2 Likes

Late Reply. Inquiring About your Script.

I would like to understand this script a little more. you have some javascript written above where you put the templater script and I am wondering if I am supposed to include the JavaScript in the templater script. Also, do I need to manually put in the moon phase information? I have no problem doing this. I love long projects and if I did do this manually I would probably include the zodiac sign. What do you think?