feat(filter-bar): add date and time limits to date and datetime pipes (#DS-5315)#1775
feat(filter-bar): add date and time limits to date and datetime pipes (#DS-5315)#1775lskramarov wants to merge 1 commit into
Conversation
|
Visit the preview URL for this PR (updated for commit 3025c82): https://koobiq-next--prs-1775-9jctcqa0.web.app (expires Mon, 27 Jul 2026 11:41:00 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c |
There was a problem hiding this comment.
Pull request overview
Adds configurable min/max selectable bounds and min/max interval constraints to the filter-bar date and datetime pipes, including localized error hints and documentation/example updates to demonstrate the new template options.
Changes:
- Extend
KbqPipeTemplatewithminDateTime/maxDateTimeandminInterval/maxIntervaloptions and wire them into the date/datetime pipe editors. - Add interval validation + localized hint rendering for “too short/too long” custom periods, plus bound-aware min/max inputs/calendars/timepickers.
- Update docs, docs examples, and locale bundles; refresh public API snapshots.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/public_api_guard/components/filter-bar.api.md | Public API snapshot updates for new template fields and new pipe component members. |
| tools/public_api_guard/components/core.api.md | Public API snapshot updates for new locale keys. |
| packages/docs-examples/components/filter-bar/index.ts | Registers the new date-limits docs example. |
| packages/docs-examples/components/filter-bar/filter-bar-date-limits/filter-bar-date-limits-example.ts | New example demonstrating min/max datetime bounds and interval constraints. |
| packages/components/filter-bar/pipes/pipe-datetime.ts | Implements usesTime() for datetime pipe behavior differences. |
| packages/components/filter-bar/pipes/pipe-datetime.spec.ts | Adds unit tests covering bounds, interval validation, and hint rendering for datetime pipe. |
| packages/components/filter-bar/pipes/pipe-datetime.html | Binds min/max to date/time inputs and adds interval hint rendering for datetime editor UI. |
| packages/components/filter-bar/pipes/pipe-date.ts | Implements usesTime() for date pipe behavior differences. |
| packages/components/filter-bar/pipes/pipe-date.spec.ts | Adds unit tests covering bounds, interval validation, and hint rendering for date pipe. |
| packages/components/filter-bar/pipes/pipe-date.html | Binds min/max to date inputs/calendars and adds interval hint rendering for date editor UI. |
| packages/components/filter-bar/pipes/pipe-date-base.ts | Core implementation: template-driven bounds + interval parsing/validation + default range reconciliation + startMax. |
| packages/components/filter-bar/filter-bar.types.ts | Extends KbqPipeTemplate with the new public configuration options and docs. |
| packages/components/filter-bar/filter-bar.ru.md | Documents new date/time limits feature in Russian and adds example reference. |
| packages/components/filter-bar/filter-bar.en.md | Documents new date/time limits feature in English and adds example reference. |
| packages/components/core/locales/tk-TM.ts | Adds localized strings for interval-too-short/too-long hints. |
| packages/components/core/locales/ru-RU.ts | Adds localized strings for interval-too-short/too-long hints. |
| packages/components/core/locales/pt-BR.ts | Adds localized strings for interval-too-short/too-long hints. |
| packages/components/core/locales/es-LA.ts | Adds localized strings for interval-too-short/too-long hints. |
| packages/components/core/locales/en-US.ts | Adds localized strings for interval-too-short/too-long hints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private toValidInterval(value: unknown): any { | ||
| if (value == null || typeof value !== 'object' || Array.isArray(value)) return undefined; | ||
|
|
||
| try { |
| @if (formGroup.controls.start.invalid || formGroup.controls.end.invalid) { | ||
| <kbq-hint class="kbq-date-period__hint" [color]="'error'"> | ||
| {{ localeData.datePipe.customPeriodErrorHint }} | ||
| </kbq-hint> |
| @if (formGroup.controls.start.invalid || formGroup.controls.end.invalid) { | ||
| <kbq-hint class="kbq-date-period__hint" [color]="'error'"> | ||
| {{ localeData.datePipe.customPeriodErrorHint }} | ||
| </kbq-hint> |
| // template is momentarily absent must not blank out previously resolved bounds. | ||
| if (!template) return; | ||
|
|
||
| const min = template.minDateTime != null ? this.toValidDate(template.minDateTime) : undefined; |
There was a problem hiding this comment.
Предлагаю чуть дописать логику и обернуть в метод
| const min = template.minDateTime != null ? this.toValidDate(template.minDateTime) : undefined; | |
| const min = this.toValidDate(template.minDateTime); |
No description provided.