首页 > 解决方案 > How to find entries between two dates?

问题描述

I tried to filter my indexdb by the start_date index, which is da Date Object. But this does not seem to work:

db.timetrackingitems
        .where("start_date")
        .between(
          dayjs(
            `${year}-${
              month < 10
                ? `0${month}`
                : month
            }-01 00:00:00`,
          ).date(),
          dayjs(
            `${year}-${
              month < 10
                ? `0${month}`
                : month
            }-31 00:00:00`,
          ).date(),
          true,
          true,
        )
        .toArray();

Is there a way to filter entries between two dates? Or is this not possible?

标签: dexie

解决方案


推荐阅读