obsidian-tracker icon indicating copy to clipboard operation
obsidian-tracker copied to clipboard

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

Open zacharycode opened this issue 1 year ago • 6 comments
trafficstars

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

zacharycode avatar Mar 01 '24 09:03 zacharycode

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

  • Open example vault
  • Copy 20210101-D, 20210102-D, 20210103-D, 20210104-D to new files without the -D
  • Go to TestCommands.md
    • Edit the Line Chart example and set
      • dateFormat: YYYYMMDD
      • startDate: 20210101
      • endDate: 20210131

And it works as expected

lazyguru avatar Mar 22 '24 05:03 lazyguru

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

zacharycode avatar Mar 22 '24 06:03 zacharycode

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.

jaafourima avatar Sep 17 '24 16:09 jaafourima