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

New travel calendar #753

Merged
merged 58 commits into from
Jul 4, 2024
Merged

New travel calendar #753

merged 58 commits into from
Jul 4, 2024

Conversation

mattias800
Copy link
Collaborator

@mattias800 mattias800 commented Jun 27, 2024

New components:

TravelDateRangeInput

Text inputs that shows an overlay with calendar when focused.

image

image

TravelDateRangeCalendar

Text inputs and calendar that are always visible.

image

New helper functions:

formatLocalizedDate(date, localeCode)

Takes a date object and formats it to standard date format for locale.

parseLocalizedDateString(dateString, localeCode)

Takes a string formatted by locale and parses it. Returns a Date object, undefined if it fails.

reformatLocalizedDateString(dateString, localeCode)

Takes an input string, parses it and reformats it according to locale.

Locale codes

Locale codes are strings, for example:

  • sv (Swedish)
  • da (danish)
  • nb (Norwegian)
  • de (German)
  • en-GB (British english)

…ndar

# Conflicts:
#	packages/calendar/package.json
#	packages/filter/package.json
…ndar

# Conflicts:
#	packages/calendar/package.json
…ndar

# Conflicts:
#	packages/calendar/package.json
- Do not parse text input until length matches date format.
…ndar

# Conflicts:
#	packages/calendar/package.json
Copy link

github-actions bot commented Jun 27, 2024

Size Change: 0 B

Total Size: 376 kB

ℹ️ View Unchanged
Filename Size
packages/calendar/dist/index.es.js 20.6 kB
packages/calendar/dist/index.js 17.2 kB
packages/core/dist/index.es.js 8.87 kB
packages/core/dist/index.js 6.91 kB
packages/elements/dist/index.es.js 102 kB
packages/elements/dist/index.js 99.3 kB
packages/filter/dist/index.es.js 3.68 kB
packages/filter/dist/index.js 3.02 kB
packages/forms/dist/index.es.js 8.51 kB
packages/forms/dist/index.js 7.7 kB
packages/grid-export/dist/index.es.js 1.89 kB
packages/grid-export/dist/index.js 1.79 kB
packages/grid/dist/index.es.js 24.6 kB
packages/grid/dist/index.js 20.3 kB
packages/input-mask/dist/index.es.js 714 B
packages/input-mask/dist/index.js 615 B
packages/modal/dist/index.es.js 6.29 kB
packages/modal/dist/index.js 5.62 kB
packages/panels/dist/index.es.js 7.12 kB
packages/panels/dist/index.js 6.18 kB
packages/redux/dist/index.es.js 2.98 kB
packages/redux/dist/index.js 2.62 kB
packages/select/dist/index.es.js 4.52 kB
packages/select/dist/index.js 3.84 kB
packages/theme/dist/index.es.js 2.01 kB
packages/theme/dist/index.js 2.04 kB
packages/tooltip/dist/index.es.js 2.89 kB
packages/tooltip/dist/index.js 2.61 kB

compressed-size-action

- Previous month stepper button is disabled if showing today's month.
…ering an earlier month will focus on today's month.

- Entering a date with missing zeroes will now be reformatted to correct date format (if valid) on blur.
- getDefaultLocaleForFormatting() can now return undefined, if no matching locale is found, instead of default sv.
- parseLocalizedDateString() returns undefined if parse fails, instead of "Invalid date". This should be less error prone since type system will enforce null checks.
- TravelDateInput now takes up correct in-line size in DOM, even though the inputs are absolute positioned.
- Fix styling of table.
- Change order of absolute positioned elements, so that tabbing works correctly again.
- Add zIndex prop, since zIndex is now needed when DOM element order is correct for tabbing, but not for rendering order.
- Reduce animation time, is now "fast".
- Make heading optional, and align absolute positioning properly when heading is missing.
- Add separate z-index when calendar popover is not visible, so that z-index doesn't interfere when having multiple inputs.
- Change selection highlight as per design.
@mattias800 mattias800 changed the title New travel calendar DRAFT New travel calendar Jul 4, 2024
@mattias800 mattias800 marked this pull request as ready for review July 4, 2024 09:35
@mattias800 mattias800 added enhancement New feature or request minor Increment the minor version when merged labels Jul 4, 2024
…ver.

- Add stories with render prop examples.
- Add `onHideCalendar` callback.
- Fix comment typo.
- Add `firstMonthInMonthPicker` and `numMonthsInMonthPicker` props.
@mattias800 mattias800 merged commit 5f373cf into master Jul 4, 2024
6 checks passed
@mattias800 mattias800 deleted the feature/travel-calendar branch July 4, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants