feat(datepicker): add period-time mode with start/end time selection in 24h format#1158
feat(datepicker): add period-time mode with start/end time selection in 24h format#1158Copilot wants to merge 13 commits into
period-time mode with start/end time selection in 24h format#1158Conversation
- Add 'period-time' to the typeDate union type - Add startTime/endTime state (defaults 00:00 / 23:59) - Render time inputs (clock icon) below the period calendar - Include startTime/endTime in concludeDatepicker event payload - Reset times on clearDate in period-time mode - Add i18n keys (startTime/endTime) for pt_BR, es_ES, en_US - Add CSS for .datepicker__menu__time-inputs two-column grid - Update Storybook with period-time option and PeriodTime story - Add unit tests for new period-time behaviour Agent-Logs-Url: https://github.com/takenet/blip-ds/sessions/756881a0-87db-4325-9685-4c69f71a6b96 Co-authored-by: tuliorezende <6129653+tuliorezende@users.noreply.github.com>
…riod class condition Agent-Logs-Url: https://github.com/takenet/blip-ds/sessions/756881a0-87db-4325-9685-4c69f71a6b96 Co-authored-by: tuliorezende <6129653+tuliorezende@users.noreply.github.com>
period-time mode with start/end time selection
…hable comparison - Add 'time' to InputType union in input-interface.ts - Replace always-true comparison `this.typeOfDate !== 'single'` in else branch with literal `true` to silence TS error TS2367" Agent-Logs-Url: https://github.com/takenet/blip-ds/sessions/4a6cb312-f9c7-479b-b206-ff1380d4db0d Co-authored-by: tuliorezende <6129653+tuliorezende@users.noreply.github.com>
|
Replace type='time' with type='text' + placeholder/pattern/maxlength to force 24h format regardless of browser locale. Add formatTimeInput helper that auto-inserts the colon separator as the user types." Agent-Logs-Url: https://github.com/takenet/blip-ds/sessions/dade8390-2fd0-4215-a9f5-0858c3450c6a Co-authored-by: tuliorezende <6129653+tuliorezende@users.noreply.github.com>
|
On the generated date fields I can't see the selected hours, only when I click in the box to select again |
In period-time mode the 'De'/'Até' trigger inputs now display the selected time alongside the date (e.g. '08/04/2026 09:00') by: - switching their type to 'text' and marking them readonly - computing value as typeDateToStringDate(date) + ' ' + time so the display reacts whenever startTime/endTime state changes. Agent-Logs-Url: https://github.com/takenet/blip-ds/sessions/634ad537-9b3a-47e0-8253-10b9401f4fa3 Co-authored-by: tuliorezende <6129653+tuliorezende@users.noreply.github.com>
|
... Fixed in commit |
period-time mode with start/end time selectionperiod-time mode with start/end time selection in 24h format
@copilot before click in the field to insert the periods I can't see the "mask" The previous issue now is solved: i can see the date and time after select properly but to keep the behavior and turn more friendly to user, would be cool to keep the mask in the "period-time" type as well |
Add placeholder='dd/mm/aaaa HH:MM' to the De/Até trigger inputs in period-time mode so users can see the expected format before selecting a date, matching the UX of the regular period mode's date mask. Agent-Logs-Url: https://github.com/takenet/blip-ds/sessions/069f41fd-7aeb-4dc1-96ac-ece33d506bf5 Co-authored-by: tuliorezende <6129653+tuliorezende@users.noreply.github.com>
|
@copilot check the pull request comments and adjust if necessary |
- Make startTime/endTime non-optional states (remove ?) - Fix type cast in onInputStartTimeSelected/EndTimeSelected to HTMLBdsInputElement - Add normalizeTime helper to pad partial HH:MM values before emitting - Normalize times in clickConcludeDatepicker before adding to payload - Fix useEffect memory leak in Storybook story (add [] dep + cleanup) - Add unit tests for formatTimeInput and normalizeTime (17 new tests, 184 total) Agent-Logs-Url: https://github.com/takenet/blip-ds/sessions/e9d41d66-049e-46c1-a2af-4699282b7174 Co-authored-by: tuliorezende <6129653+tuliorezende@users.noreply.github.com>
All 5 review points addressed in commit
|
@copilot The events when I change the date and I change the hour are resulting in different values. Can you adjust the values on events to standarize the values? |
…at to dd/mm/yyyy
The bdsStartDate and bdsEndDate events now emit { value: "dd/mm/yyyy" } (using
dateToString) instead of a raw Date object, matching the format used in the
concludeDatepicker payload and the trigger input display.
Agent-Logs-Url: https://github.com/takenet/blip-ds/sessions/59ab1976-e491-4709-add3-fa7f2b08a602
Co-authored-by: tuliorezende <6129653+tuliorezende@users.noreply.github.com>
Fixed in the latest commit. The |
…ing up The bds-datepicker-period component's bdsStartDate/bdsEndDate events were bubbling up (composed: true by default in Stencil v2) to the parent bds-datepicker host element, causing listeners on the parent to receive both the raw child event (with a Date object) and the parent's own re-emitted event (with a formatted string). Added event.stopPropagation() in selectDate/selectEndDate so the child's event is consumed at the parent handler and does not propagate further. Agent-Logs-Url: https://github.com/takenet/blip-ds/sessions/40dd355e-9f76-4522-af16-f73dd5a149e1 Co-authored-by: tuliorezende <6129653+tuliorezende@users.noreply.github.com>
|
after the latests updates can you provide some react snippet in this pull request about how can I retrieve the start and end values (with date and times)? |
…andlers Agent-Logs-Url: https://github.com/takenet/blip-ds/sessions/6077fa57-d564-4910-b039-c204e96d2960 Co-authored-by: tuliorezende <6129653+tuliorezende@users.noreply.github.com>
A live working example has been added to Storybook as the FrameworkReactPeriodTime story (commit Here's how to retrieve all values in React after the latest updates: import { BdsDatepicker } from 'blip-ds/dist/blip-ds-react';
function MyComponent() {
const handleConclude = (event: CustomEvent) => {
const { startDate, startTime, endDate, endTime } = event.detail;
// startDate / endDate → "dd/mm/yyyy" (e.g. "01/04/2026")
// startTime / endTime → "HH:MM" (e.g. "10:00")
console.log(`De: ${startDate} ${startTime}`); // "01/04/2026 10:00"
console.log(`Até: ${endDate} ${endTime}`); // "17/04/2026 23:59"
};
return (
<BdsDatepicker
typeOfDate="period-time"
startDateLimit="31/12/2022"
endDateLimit="01/01/2027"
onConcludeDatepicker={handleConclude}
onBdsStartDate={(e) => console.log('Data inicial:', e.detail.value)} // "dd/mm/yyyy"
onBdsEndDate={(e) => console.log('Data final:', e.detail.value)} // "dd/mm/yyyy"
onEmptyConcludeDatepicker={() => { /* picker reset — clear state */ }}
/>
);
}Event summary:
|



startTime/endTimenon-optional statesonInputStartTimeSelected/onInputEndTimeSelectednormalizeTimehelper and normalize times before emittingconcludeDatepickeruseEffectmemory leakformatTimeInputandnormalizeTimebdsStartDate/bdsEndDateevent value format todd/mm/yyyyevent.stopPropagation()inselectDate/selectEndDateFrameworkReactPeriodTimeStorybook story showing all events with React wrapper