offset-dev / strapi-calendar

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

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

Open rehantoday opened 4 months ago

rehantoday commented 4 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 1 month 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 think it's possible Do you have documentation or an example I can run to get it to work?