YukiGasai / obsidian-google-calendar

Add Google Calendar inside Obsidian
https://yukigasai.github.io/obsidian-google-calendar/
GNU General Public License v3.0
342 stars 24 forks source link

FrontMatterParser should create the date or dateTime object based on the start/startTime provided #231

Open vanish87 opened 7 months ago

vanish87 commented 7 months ago

src/helper/FrontMatterParser.ts

//Check for start and end date if there is none defined
    if (!frontmatter.start && !frontmatter.startTime) {
        frontmatter.start = { date: window.moment() }
    }

Google Calendar API will use 'start': {'date': For date only 'start': {'dateTime': For dateTime

Possible fix:

//Check for start and end date if there is none defined
if (!frontmatter.start)
{
    if(!frontmatter.startTime) frontmatter.start = { date: window.moment() }
    else {frontmatter.start = { dateTime: window.moment() }
}