pyrochlore / obsidian-tracker

A plugin tracks occurrences and numbers in your notes
MIT License
1.37k stars 229 forks source link

Date format(YYYYMMDD) not working properly for start/end Date #324

Open zacharycode opened 9 months ago

zacharycode commented 9 months ago

When my date format is set to YYYY-MM-DD, there are no issues, but when the date format is set to YYYYMMDD, the settings for the start date and end date become ineffective.

YYYYMMDD

searchType: tag
searchTarget: weight
dateFormat: YYYYMMDD
startDate: 20240201
endDate: 20240203
fitPanelWidth: 1
line:
    title: Weight Log
    yAxisLabel: Weight
    yAxisUnit: kg
    lineColor: yellow

截屏2024-03-01 下午5 19 23

YYYY-MM-DD

searchType: tag
searchTarget: weight
dateFormat: YYYY-MM-DD
startDate: 2024-02-01
endDate: 2024-02-03
fitPanelWidth: 1
line:
    title: Weight Log
    yAxisLabel: Weight
    yAxisUnit: kg
    lineColor: yellow

截屏2024-03-01 下午5 19 29

lazyguru commented 8 months ago

Whatever you set the date format to, that's how your files need to be named as well. I did the following:

And it works as expected

zacharycode commented 8 months ago

Thank you for your reply. In your experiment, there is only data from certain days in 2021, so the problem cannot be seen. When you add some data from 2018 and 2019, you will find that the set start and end times are invalid. Please see my new post pictures, thank you!! 1 2 3

jaafourima commented 2 months ago

I'm having the exact same problem. Regardless of startDate and endDate all file in the folder are included. If I change dateFormat to anything other than 'YYYYMMDD' the problem goes away.