Skip to content

Conversation

@Bhoomaahamso
Copy link

@Bhoomaahamso Bhoomaahamso commented Dec 13, 2025

Title: "feat: Add second, minute & hour resolution options to relative date Filter action"

Summary

This PR enables support for smaller time units β€” Seconds, Minutes, and Hours β€” in the Relative Date filter used in workflows, rather than being limited to days only.


What Changed

This PR extends the relative date filter to include support for the following units:

βœ”οΈ SECOND
βœ”οΈ MINUTE
βœ”οΈ HOUR
βœ”οΈ (Existing: DAY, WEEK, MONTH, etc.)

Changes include:

  • Adding SECOND, MINUTE, and HOUR options to the internal relative date unit enum/constant.
  • Updating utility functions and parsers to correctly interpret and evaluate these new units.
  • Enhancing existing tests and adding new tests to cover second, minute, and hour relative filters.

Testing

New and updated tests include:

  • Unit tests for serialization of relative filter values including seconds, minutes, and hours.
  • Workflow filter evaluation tests that verify minute/hour resolution behaves correctly.

Tests are included in the changeset.


Backward Compatibility

This change is fully backward compatible:

  • All existing relative date filters using days or larger units behave exactly as before.
  • Adding finer units does not alter existing stored data or workflow definitions.

Issue Reference

Fixes: #15525

image

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@github-actions
Copy link
Contributor

Welcome!

Hello there, congrats on your first PR! We're excited to have you contributing to this project.
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.

Generated by 🚫 dangerJS against b5dd32c

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 11 files

@github-actions
Copy link
Contributor

πŸš€ Preview Environment Ready!

Your preview environment is available at: http://bore.pub:41106

This environment will automatically shut down when the PR is closed or after 5 hours.

@guillim
Copy link
Contributor

guillim commented Dec 15, 2025

Is that something we want to add in the UI @Bonapara ? (the more options, the messier it can feel)
IMO it would be a good addition but just double checking what the product wants

@Bonapara
Copy link
Member

I think it is a great addition but:

  • Seconds should be the last option, not the first
  • It should only be available for datetime

@guillim
Copy link
Contributor

guillim commented Dec 15, 2025

Great. I will let you implement those feedback @Bhoomaahamso . But that's a great addition to our CRM. thanks for the work

I think it is a great addition but:

  • Seconds should be the last option, not the first
  • It should only be available for datetime

@Bhoomaahamso
Copy link
Author

Hi @Bonapara @guillim ,
For point 1, do you mean the order should be ['Minute', 'Hour', 'Day', 'Week', 'Month', 'Year', 'Second'] or ['Day', 'Week', 'Month', 'Year', 'Hour', 'Minute', 'Second']? I would appreciate if you could specify it.

For point 2, both DateTimePicker and DatePicker use options from RELATIVE_DATE_UNITS_SELECT_OPTIONS. Do you think I should create a new variable specifically for DateTimePicker and use it within RelativeDatePickerHeader based on a condition?

@guillim
Copy link
Contributor

guillim commented Dec 15, 2025

Hi @Bonapara @guillim , For point 1, do you mean the order should be ['Minute', 'Hour', 'Day', 'Week', 'Month', 'Year', 'Second'] or ['Day', 'Week', 'Month', 'Year', 'Hour', 'Minute', 'Second']? I would appreciate if you could specify it.

-> ['Day', 'Week', 'Month', 'Year', 'Hour', 'Minute', 'Second']

For point 2, both DateTimePicker and DatePicker use options from RELATIVE_DATE_UNITS_SELECT_OPTIONS. Do you think I should create a new variable specifically for DateTimePicker and use it within RelativeDatePickerHeader based on a condition?

-> yes please. in the same file will be fine.
sometihng like

export const RELATIVE_DATETIME_UNITS_SELECT_OPTIONS: RelativeDateUnitOption[] = [
   ...RELATIVE_DATE_UNITS_SELECT_OPTIONS,
  { value: 'HOUR', label: 'Hour' },
  { value: 'MINUTE', label: 'Minute' },
  { value: 'SECOND', label: 'Second' },
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants