Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rehantoday opened this issue Jul 3, 2024 · 1 comment
Open
Labels
enhancement New feature or request waiting for op Needs action from the original poster

Comments

@rehantoday
Copy link

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 LuisRodriguezLD added the enhancement New feature or request label Oct 2, 2024
@LuisRodriguezLD
Copy link
Contributor

LuisRodriguezLD commented Oct 2, 2024

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?

@LuisRodriguezLD LuisRodriguezLD added the waiting for op Needs action from the original poster label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request waiting for op Needs action from the original poster
Projects
None yet
Development

No branches or pull requests

2 participants