offset-dev / strapi-calendar

Visualize your Strapi content in month, week or daily view
36 stars 13 forks source link

Suggestion: Using component fields to select start/end datetime #45

Open rehantoday opened 3 months ago

rehantoday commented 3 months ago

While exploring this plugin, I have noticed that if I have a use-case where I have a component inside an entity which is used to group related fields. I cannot select datetime or title from inside that component.

Example:

|__ Entity: Program
    |__ Component 1: Basic Data
         |__ Name:
         |__ Details:
    |__ Component 2: Timing
         |__ Start Time:
         |__ End Time:

I wonder if this is a popular use-case or not. But at least in my experience this is a much-needed feature.

LuisRodriguezLD commented 3 weeks ago

I love this idea however, I've working on this and I'm unable to query by component's value. In other words, this fails:

await strapi.documents(config.collection).findMany({
        filters: {
          $and: [
            {
              'timing.startTime': {
                $gte: moment(startDate).startOf('day').format(),
                $lte: moment(endDate).endOf('day').format(),
              },
            },
          ],
        },
      })

I've been searching and I don't it's possible Do you have documentation or an example I can run to get it to work?