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

allow date comparisons in segment rules #3971

Open
orionxiao opened this issue May 17, 2024 · 6 comments
Open

allow date comparisons in segment rules #3971

orionxiao opened this issue May 17, 2024 · 6 comments
Labels
api Issue related to the REST API improvement sdk Issues related to the SDKs

Comments

@orionxiao
Copy link

Is your feature request related to a problem? Please describe.

I would like to be able to do date comparisons on a trait in a way that is easy for non-technical users to configure.

Describe the solution you'd like.

New rule operators that allow for date comparison, e.g. some_trait [before | on | after] YYYY-MM-DD, where some_trait could be an ISO-formatted date string, epoch time, or some other format (doesn't really matter). In terms of impl, would probably just be a wrapper around numeric comparison with epoch time.

Describe alternatives you've considered

This is currently possible with numeric comparison if we use epoch time on both sides. However, it would be a nice QOL feature (especially for non-technical users) if we didn't have to do the conversion or think about epoch time at all.

Additional context

No response

@dabeeeenster dabeeeenster added improvement api Issue related to the REST API sdk Issues related to the SDKs labels May 17, 2024
@utkarsh-1905
Copy link
Contributor

Can i take this up?

@matthewelwell
Copy link
Contributor

Hi @utkarsh-1905 , this is quite a large amount of work as it will need to be implemented in the engine code in all of our server side SDKs. If you're willing to take all of that on, then great, yes!

In terms of the design for this, I think we will need some new operators to ensure that the engine knows when to correctly format the value as a date. When these operators are chosen in the UI, it should provide a date picker to select from.

@utkarsh-1905
Copy link
Contributor

Yes, I am willing to take this up, in turn this will help me to understand the codebase better, so I can contribute more in the future, though I will ask a lot of doubts here 😅

@dabeeeenster
Copy link
Contributor

We need to give consideration here to timezones too?

@matthewelwell
Copy link
Contributor

We need to give consideration here to timezones too?

Hmm... yes, I guess we either need the dates to always be TZ aware or always NOT TZ aware (and hence we assume UTC). We perhaps needs to do some research into what other feature flagging / analytics tools are doing in this regard to get some inspiration. @utkarsh-1905 could you take a look?

@utkarsh-1905
Copy link
Contributor

Sure I will

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API improvement sdk Issues related to the SDKs
Projects
None yet
Development

No branches or pull requests

4 participants