@ionic/core 7.7.3-dev.11707927732.13defc00 → 7.7.3-dev.11709159644.114cd8b1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/components/data.js +23 -38
  2. package/components/ion-content.js +3 -4
  3. package/components/ion-datetime-button.js +11 -10
  4. package/components/ion-datetime.js +69 -7
  5. package/components/ion-searchbar.js +34 -5
  6. package/dist/cjs/{data-a5109f09.js → data-4487a815.js} +22 -39
  7. package/dist/cjs/ion-app_8.cjs.entry.js +3 -4
  8. package/dist/cjs/ion-datetime-button.cjs.entry.js +11 -10
  9. package/dist/cjs/ion-datetime_3.cjs.entry.js +66 -7
  10. package/dist/cjs/ion-searchbar.cjs.entry.js +28 -4
  11. package/dist/cjs/ionic.cjs.js +1 -1
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/collection/components/content/content.js +3 -4
  14. package/dist/collection/components/datetime/datetime.js +50 -7
  15. package/dist/collection/components/datetime/test/basic/datetime.e2e.js +77 -0
  16. package/dist/collection/components/datetime/test/format.spec.js +65 -15
  17. package/dist/collection/components/datetime/utils/format.js +24 -37
  18. package/dist/collection/components/datetime/utils/validate.js +45 -0
  19. package/dist/collection/components/datetime-button/datetime-button.js +11 -10
  20. package/dist/collection/components/datetime-button/test/basic/datetime-button.e2e.js +65 -0
  21. package/dist/collection/components/searchbar/searchbar.js +84 -5
  22. package/dist/collection/components/searchbar/test/searchbar.spec.js +20 -2
  23. package/dist/docs.json +113 -1
  24. package/dist/esm/{data-0f3ab200.js → data-bb424ba8.js} +23 -38
  25. package/dist/esm/ion-app_8.entry.js +3 -4
  26. package/dist/esm/ion-datetime-button.entry.js +11 -10
  27. package/dist/esm/ion-datetime_3.entry.js +66 -7
  28. package/dist/esm/ion-searchbar.entry.js +29 -5
  29. package/dist/esm/ionic.js +1 -1
  30. package/dist/esm/loader.js +1 -1
  31. package/dist/esm-es5/data-bb424ba8.js +4 -0
  32. package/dist/esm-es5/ion-app_8.entry.js +1 -1
  33. package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
  34. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  35. package/dist/esm-es5/ion-searchbar.entry.js +1 -1
  36. package/dist/esm-es5/ionic.js +1 -1
  37. package/dist/esm-es5/loader.js +1 -1
  38. package/dist/html.html-data.json +12 -0
  39. package/dist/ionic/ionic.esm.js +1 -1
  40. package/dist/ionic/p-0b34d3a7.system.js +1 -1
  41. package/dist/ionic/p-2d95cfc5.entry.js +4 -0
  42. package/dist/ionic/p-31450f73.entry.js +4 -0
  43. package/dist/ionic/p-3789920e.js +4 -0
  44. package/dist/ionic/p-8a1b0abb.system.js +4 -0
  45. package/dist/ionic/p-9f207856.entry.js +4 -0
  46. package/dist/ionic/p-b18b2148.system.entry.js +4 -0
  47. package/dist/ionic/p-d8ee0efe.system.entry.js +4 -0
  48. package/dist/ionic/p-dbd70d97.system.entry.js +4 -0
  49. package/dist/ionic/p-e942b677.entry.js +4 -0
  50. package/dist/ionic/p-e9b9a128.system.entry.js +4 -0
  51. package/dist/types/components/datetime/datetime-interface.d.ts +10 -0
  52. package/dist/types/components/datetime/datetime.d.ts +9 -1
  53. package/dist/types/components/datetime/utils/format.d.ts +7 -13
  54. package/dist/types/components/datetime/utils/validate.d.ts +8 -0
  55. package/dist/types/components/searchbar/searchbar.d.ts +38 -0
  56. package/dist/types/components.d.ts +34 -2
  57. package/hydrate/index.js +130 -60
  58. package/package.json +1 -1
  59. package/dist/esm-es5/data-0f3ab200.js +0 -4
  60. package/dist/ionic/p-0e23c289.system.entry.js +0 -4
  61. package/dist/ionic/p-206c34f8.system.entry.js +0 -4
  62. package/dist/ionic/p-2327064c.entry.js +0 -4
  63. package/dist/ionic/p-23c73017.entry.js +0 -4
  64. package/dist/ionic/p-68ba8e77.system.entry.js +0 -4
  65. package/dist/ionic/p-7330c044.system.js +0 -4
  66. package/dist/ionic/p-8821fd17.entry.js +0 -4
  67. package/dist/ionic/p-a6e465f5.entry.js +0 -4
  68. package/dist/ionic/p-e81bf09e.system.entry.js +0 -4
  69. package/dist/ionic/p-f7dce541.js +0 -4
@@ -4,12 +4,30 @@
4
4
  import { newSpecPage } from "@stencil/core/testing";
5
5
  import { Searchbar } from "../searchbar";
6
6
  describe('searchbar: rendering', () => {
7
- it('should inherit attributes', async () => {
7
+ it('should inherit properties on load', async () => {
8
8
  const page = await newSpecPage({
9
9
  components: [Searchbar],
10
- html: '<ion-searchbar name="search"></ion-searchbar>',
10
+ html: '<ion-searchbar autocapitalize="off" maxlength="4" minlength="2" name="search"></ion-searchbar>',
11
11
  });
12
12
  const nativeEl = page.body.querySelector('ion-searchbar input');
13
13
  expect(nativeEl.getAttribute('name')).toBe('search');
14
+ expect(nativeEl.getAttribute('maxlength')).toBe('4');
15
+ expect(nativeEl.getAttribute('minlength')).toBe('2');
16
+ expect(nativeEl.getAttribute('autocapitalize')).toBe('off');
17
+ });
18
+ it('should inherit watched attributes', async () => {
19
+ const page = await newSpecPage({
20
+ components: [Searchbar],
21
+ html: '<ion-searchbar dir="ltr" lang="en-US"></ion-searchbar>',
22
+ });
23
+ const searchbarEl = page.body.querySelector('ion-searchbar');
24
+ const nativeEl = searchbarEl.querySelector('input');
25
+ expect(nativeEl.getAttribute('lang')).toBe('en-US');
26
+ expect(nativeEl.getAttribute('dir')).toBe('ltr');
27
+ searchbarEl.setAttribute('lang', 'es-ES');
28
+ searchbarEl.setAttribute('dir', 'rtl');
29
+ await page.waitForChanges();
30
+ expect(nativeEl.getAttribute('lang')).toBe('es-ES');
31
+ expect(nativeEl.getAttribute('dir')).toBe('rtl');
14
32
  });
15
33
  });
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-02-14T16:24:00",
2
+ "timestamp": "2024-02-28T22:36:34",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.12.2",
@@ -7086,6 +7086,44 @@
7086
7086
  "optional": false,
7087
7087
  "required": false
7088
7088
  },
7089
+ {
7090
+ "name": "formatOptions",
7091
+ "type": "undefined | { date: DateTimeFormatOptions; time?: DateTimeFormatOptions | undefined; } | { date?: DateTimeFormatOptions | undefined; time: DateTimeFormatOptions; }",
7092
+ "complexType": {
7093
+ "original": "FormatOptions",
7094
+ "resolved": "undefined | { date: DateTimeFormatOptions; time?: DateTimeFormatOptions | undefined; } | { date?: DateTimeFormatOptions | undefined; time: DateTimeFormatOptions; }",
7095
+ "references": {
7096
+ "FormatOptions": {
7097
+ "location": "import",
7098
+ "path": "./datetime-interface",
7099
+ "id": "src/components/datetime/datetime-interface.ts::FormatOptions"
7100
+ }
7101
+ }
7102
+ },
7103
+ "mutable": false,
7104
+ "reflectToAttr": false,
7105
+ "docs": "Formatting options for dates and times.\nShould include a 'date' and/or 'time' object, each of which is of type [Intl.DateTimeFormatOptions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options).",
7106
+ "docsTags": [],
7107
+ "values": [
7108
+ {
7109
+ "type": "undefined"
7110
+ },
7111
+ {
7112
+ "type": "{ date: DateTimeFormatOptions; time?: DateTimeFormatOptions"
7113
+ },
7114
+ {
7115
+ "type": "undefined; }"
7116
+ },
7117
+ {
7118
+ "type": "{ date?: DateTimeFormatOptions"
7119
+ },
7120
+ {
7121
+ "type": "undefined; time: DateTimeFormatOptions; }"
7122
+ }
7123
+ ],
7124
+ "optional": true,
7125
+ "required": false
7126
+ },
7089
7127
  {
7090
7128
  "name": "highlightedDates",
7091
7129
  "type": "((dateIsoString: string) => DatetimeHighlightStyle | undefined) | DatetimeHighlight[] | undefined",
@@ -22393,6 +22431,27 @@
22393
22431
  "optional": false,
22394
22432
  "required": false
22395
22433
  },
22434
+ {
22435
+ "name": "autocapitalize",
22436
+ "type": "string",
22437
+ "complexType": {
22438
+ "original": "string",
22439
+ "resolved": "string",
22440
+ "references": {}
22441
+ },
22442
+ "mutable": false,
22443
+ "attr": "autocapitalize",
22444
+ "reflectToAttr": false,
22445
+ "docs": "Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\nAvailable options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.",
22446
+ "docsTags": [],
22447
+ "values": [
22448
+ {
22449
+ "type": "string"
22450
+ }
22451
+ ],
22452
+ "optional": false,
22453
+ "required": true
22454
+ },
22396
22455
  {
22397
22456
  "name": "autocomplete",
22398
22457
  "type": "\"name\" | \"email\" | \"tel\" | \"url\" | \"on\" | \"off\" | \"honorific-prefix\" | \"given-name\" | \"additional-name\" | \"family-name\" | \"honorific-suffix\" | \"nickname\" | \"username\" | \"new-password\" | \"current-password\" | \"one-time-code\" | \"organization-title\" | \"organization\" | \"street-address\" | \"address-line1\" | \"address-line2\" | \"address-line3\" | \"address-level4\" | \"address-level3\" | \"address-level2\" | \"address-level1\" | \"country\" | \"country-name\" | \"postal-code\" | \"cc-name\" | \"cc-given-name\" | \"cc-additional-name\" | \"cc-family-name\" | \"cc-number\" | \"cc-exp\" | \"cc-exp-month\" | \"cc-exp-year\" | \"cc-csc\" | \"cc-type\" | \"transaction-currency\" | \"transaction-amount\" | \"language\" | \"bday\" | \"bday-day\" | \"bday-month\" | \"bday-year\" | \"sex\" | \"tel-country-code\" | \"tel-national\" | \"tel-area-code\" | \"tel-local\" | \"tel-extension\" | \"impp\" | \"photo\"",
@@ -22943,6 +23002,54 @@
22943
23002
  "optional": true,
22944
23003
  "required": false
22945
23004
  },
23005
+ {
23006
+ "name": "maxlength",
23007
+ "type": "number | undefined",
23008
+ "complexType": {
23009
+ "original": "number",
23010
+ "resolved": "number | undefined",
23011
+ "references": {}
23012
+ },
23013
+ "mutable": false,
23014
+ "attr": "maxlength",
23015
+ "reflectToAttr": false,
23016
+ "docs": "This attribute specifies the maximum number of characters that the user can enter.",
23017
+ "docsTags": [],
23018
+ "values": [
23019
+ {
23020
+ "type": "number"
23021
+ },
23022
+ {
23023
+ "type": "undefined"
23024
+ }
23025
+ ],
23026
+ "optional": true,
23027
+ "required": false
23028
+ },
23029
+ {
23030
+ "name": "minlength",
23031
+ "type": "number | undefined",
23032
+ "complexType": {
23033
+ "original": "number",
23034
+ "resolved": "number | undefined",
23035
+ "references": {}
23036
+ },
23037
+ "mutable": false,
23038
+ "attr": "minlength",
23039
+ "reflectToAttr": false,
23040
+ "docs": "This attribute specifies the minimum number of characters that the user can enter.",
23041
+ "docsTags": [],
23042
+ "values": [
23043
+ {
23044
+ "type": "number"
23045
+ },
23046
+ {
23047
+ "type": "undefined"
23048
+ }
23049
+ ],
23050
+ "optional": true,
23051
+ "required": false
23052
+ },
22946
23053
  {
22947
23054
  "name": "mode",
22948
23055
  "type": "\"ios\" | \"md\"",
@@ -29369,6 +29476,11 @@
29369
29476
  "docstring": "",
29370
29477
  "path": "src/components/content/content-interface.ts"
29371
29478
  },
29479
+ "src/components/datetime/datetime-interface.ts::FormatOptions": {
29480
+ "declaration": "export type FormatOptions =\n | {\n date: Intl.DateTimeFormatOptions;\n time?: Intl.DateTimeFormatOptions;\n }\n | {\n date?: Intl.DateTimeFormatOptions;\n time: Intl.DateTimeFormatOptions;\n };",
29481
+ "docstring": "",
29482
+ "path": "src/components/datetime/datetime-interface.ts"
29483
+ },
29372
29484
  "src/components/datetime/datetime-interface.ts::DatetimePresentation": {
29373
29485
  "declaration": "export type DatetimePresentation = 'date-time' | 'time-date' | 'date' | 'time' | 'month' | 'year' | 'month-year';",
29374
29486
  "docstring": "",
@@ -832,7 +832,25 @@ const getFormattedDayPeriod = (dayPeriod) => {
832
832
  }
833
833
  return dayPeriod.toUpperCase();
834
834
  };
835
- const getLocalizedTime = (locale, refParts, hourCycle) => {
835
+ /**
836
+ * Including time zone options may lead to the rendered text showing a
837
+ * different time from what was selected in the Datetime, which could cause
838
+ * confusion.
839
+ */
840
+ const stripTimeZone = (formatOptions) => {
841
+ return Object.assign(Object.assign({}, formatOptions), {
842
+ /**
843
+ * Setting the time zone to UTC ensures that the value shown is always the
844
+ * same as what was selected and safeguards against older Safari bugs with
845
+ * Intl.DateTimeFormat.
846
+ */
847
+ timeZone: 'UTC',
848
+ /**
849
+ * We do not want to display the time zone name
850
+ */
851
+ timeZoneName: undefined });
852
+ };
853
+ const getLocalizedTime = (locale, refParts, hourCycle, formatOptions = { hour: 'numeric', minute: 'numeric' }) => {
836
854
  const timeParts = {
837
855
  hour: refParts.hour,
838
856
  minute: refParts.minute,
@@ -840,28 +858,12 @@ const getLocalizedTime = (locale, refParts, hourCycle) => {
840
858
  if (timeParts.hour === undefined || timeParts.minute === undefined) {
841
859
  return 'Invalid Time';
842
860
  }
843
- return new Intl.DateTimeFormat(locale, {
844
- hour: 'numeric',
845
- minute: 'numeric',
846
- /**
847
- * Setting the timeZone to UTC prevents
848
- * new Intl.DatetimeFormat from subtracting
849
- * the user's current timezone offset
850
- * when formatting the time.
851
- */
852
- timeZone: 'UTC',
861
+ return new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, stripTimeZone(formatOptions)), {
853
862
  /**
854
863
  * We use hourCycle here instead of hour12 due to:
855
864
  * https://bugs.chromium.org/p/chromium/issues/detail?id=1347316&q=hour12&can=2
856
865
  */
857
- hourCycle,
858
- /**
859
- * Setting Z at the end indicates that this
860
- * date string is in the UTC time zone. This
861
- * prevents new Date from adding the time zone
862
- * offset when getting the ISO string.
863
- */
864
- }).format(new Date(convertDataToISO(Object.assign({
866
+ hourCycle })).format(new Date(convertDataToISO(Object.assign({
865
867
  /**
866
868
  * JS uses a simplified ISO 8601 format which allows for
867
869
  * date-only formats and date-time formats, but not
@@ -947,14 +949,6 @@ const generateDayAriaLabel = (locale, today, refParts) => {
947
949
  */
948
950
  return today ? `Today, ${labelString}` : labelString;
949
951
  };
950
- /**
951
- * Gets the day of the week, month, and day
952
- * Used for the header in MD mode.
953
- */
954
- const getMonthAndDay = (locale, refParts) => {
955
- const date = getNormalizedDate(refParts);
956
- return new Intl.DateTimeFormat(locale, { weekday: 'short', month: 'short', day: 'numeric', timeZone: 'UTC' }).format(date);
957
- };
958
952
  /**
959
953
  * Given a locale and a date object,
960
954
  * return a formatted string that includes
@@ -965,15 +959,6 @@ const getMonthAndYear = (locale, refParts) => {
965
959
  const date = getNormalizedDate(refParts);
966
960
  return new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(date);
967
961
  };
968
- /**
969
- * Given a locale and a date object,
970
- * return a formatted string that includes
971
- * the short month, numeric day, and full year.
972
- * Example: Apr 22, 2021
973
- */
974
- const getMonthDayAndYear = (locale, refParts) => {
975
- return getLocalizedDateTime(locale, refParts, { month: 'short', day: 'numeric', year: 'numeric' });
976
- };
977
962
  /**
978
963
  * Given a locale and a date object,
979
964
  * return a formatted string that includes
@@ -1023,7 +1008,7 @@ const getNormalizedDate = (refParts) => {
1023
1008
  */
1024
1009
  const getLocalizedDateTime = (locale, refParts, options) => {
1025
1010
  const date = getNormalizedDate(refParts);
1026
- return getDateTimeFormat(locale, options).format(date);
1011
+ return getDateTimeFormat(locale, stripTimeZone(options)).format(date);
1027
1012
  };
1028
1013
  /**
1029
1014
  * Given a locale, DatetimeParts, and options
@@ -1622,4 +1607,4 @@ const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, all
1622
1607
  };
1623
1608
  };
1624
1609
 
1625
- export { getNumDaysInMonth as A, getCombinedDateColumnData as B, getMonthColumnData as C, getDayColumnData as D, getYearColumnData as E, isMonthFirstLocale as F, getTimeColumnsData as G, isLocaleDayPeriodRTL as H, getDaysOfWeek as I, getMonthAndYear as J, getDaysOfMonth as K, getHourCycle as L, getLocalizedTime as M, getMonthAndDay as N, formatValue as O, clampDate as P, parseAmPm as Q, calculateHourFromAMPM as R, getLocalizedDateTime as S, getMonthDayAndYear as T, getDay as a, isAfter as b, isSameDay as c, getPreviousMonth as d, getNextMonth as e, getPartsFromCalendarDay as f, generateDayAriaLabel as g, getNextYear as h, isBefore as i, getPreviousYear as j, getEndOfWeek as k, getStartOfWeek as l, getPreviousDay as m, getNextDay as n, getPreviousWeek as o, getNextWeek as p, parseMinParts as q, parseMaxParts as r, parseDate as s, convertToArrayOfNumbers as t, convertDataToISO as u, validateParts as v, warnIfValueOutOfBounds as w, getToday as x, getClosestValidDate as y, generateMonths as z };
1610
+ export { getNumDaysInMonth as A, getCombinedDateColumnData as B, getMonthColumnData as C, getDayColumnData as D, getYearColumnData as E, isMonthFirstLocale as F, getTimeColumnsData as G, isLocaleDayPeriodRTL as H, getDaysOfWeek as I, getMonthAndYear as J, getDaysOfMonth as K, getHourCycle as L, getLocalizedTime as M, getLocalizedDateTime as N, formatValue as O, clampDate as P, parseAmPm as Q, calculateHourFromAMPM as R, getDay as a, isAfter as b, isSameDay as c, getPreviousMonth as d, getNextMonth as e, getPartsFromCalendarDay as f, generateDayAriaLabel as g, getNextYear as h, isBefore as i, getPreviousYear as j, getEndOfWeek as k, getStartOfWeek as l, getPreviousDay as m, getNextDay as n, getPreviousWeek as o, getNextWeek as p, parseMinParts as q, parseMaxParts as r, parseDate as s, convertToArrayOfNumbers as t, convertDataToISO as u, validateParts as v, warnIfValueOutOfBounds as w, getToday as x, getClosestValidDate as y, generateMonths as z };
@@ -471,9 +471,8 @@ const Content = class {
471
471
  const forceOverscroll = this.shouldForceOverscroll();
472
472
  const transitionShadow = mode === 'ios';
473
473
  const TagType = isMainContent ? 'main' : 'div';
474
- console.log('content render');
475
474
  this.resize();
476
- return (h(Host, { key: '633a697a4212fd7f291052bc5e2907c12992dc0c', class: createColorClasses(this.color, {
475
+ return (h(Host, { key: '65d85e1f7f85876a76eec79addc4bd9f697a5d84', class: createColorClasses(this.color, {
477
476
  [mode]: true,
478
477
  'content-sizing': hostContext('ion-popover', this.el),
479
478
  overscroll: forceOverscroll,
@@ -481,12 +480,12 @@ const Content = class {
481
480
  }), style: {
482
481
  '--offset-top': `${this.cTop}px`,
483
482
  '--offset-bottom': `${this.cBottom}px`,
484
- } }, h("div", { key: 'dddbbeb79797bbcab9d75915c843d0be12e1bb59', ref: (el) => (this.backgroundContentEl = el), id: "background-content", part: "background" }), h(TagType, { key: '18f37ebafb0c136ceaf55714c135a2324691d9a9', class: {
483
+ } }, h("div", { key: 'e2ac474a62cbc864772c497469100436f41289ff', ref: (el) => (this.backgroundContentEl = el), id: "background-content", part: "background" }), h(TagType, { key: '567a4bc2bcb13adfd987b088f95ac4b20b789f2c', class: {
485
484
  'inner-scroll': true,
486
485
  'scroll-x': scrollX,
487
486
  'scroll-y': scrollY,
488
487
  overscroll: (scrollX || scrollY) && forceOverscroll,
489
- }, ref: (scrollEl) => (this.scrollEl = scrollEl), onScroll: this.scrollEvents ? (ev) => this.onScroll(ev) : undefined, part: "scroll" }, h("slot", { key: '3893e1142367938e35c6ff67095b6074a2b5dad1' })), transitionShadow ? (h("div", { class: "transition-effect" }, h("div", { class: "transition-cover" }), h("div", { class: "transition-shadow" }))) : null, h("slot", { key: '2fb9cdb61bae969d23ee8b190ab26e403a46481d', name: "fixed" })));
488
+ }, ref: (scrollEl) => (this.scrollEl = scrollEl), onScroll: this.scrollEvents ? (ev) => this.onScroll(ev) : undefined, part: "scroll" }, h("slot", { key: '13909f87dd9f49bf1664ad95038499da376b9480' })), transitionShadow ? (h("div", { class: "transition-effect" }, h("div", { class: "transition-cover" }), h("div", { class: "transition-shadow" }))) : null, h("slot", { key: '05b56c139e203cfd1e3dd08054e99328e97e9243', name: "fixed" })));
490
489
  }
491
490
  get el() { return getElement(this); }
492
491
  };
@@ -6,7 +6,7 @@ import { a as addEventListener, c as componentOnReady } from './helpers-c0b9ca37
6
6
  import { a as printIonError } from './index-9b0d46f4.js';
7
7
  import { c as createColorClasses } from './theme-01f3f29c.js';
8
8
  import { b as getIonMode } from './ionic-global-ad9a1810.js';
9
- import { s as parseDate, x as getToday, L as getHourCycle, S as getLocalizedDateTime, J as getMonthAndYear, M as getLocalizedTime, T as getMonthDayAndYear } from './data-0f3ab200.js';
9
+ import { s as parseDate, x as getToday, L as getHourCycle, N as getLocalizedDateTime, M as getLocalizedTime } from './data-bb424ba8.js';
10
10
 
11
11
  const iosDatetimeButtonCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host button{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px;margin-top:0px;margin-bottom:0px;position:relative;-webkit-transition:150ms color ease-in-out;transition:150ms color ease-in-out;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:1rem;cursor:pointer;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host(.time-active) #time-button,:host(.date-active) #date-button{color:var(--ion-color-base)}:host(.datetime-button-disabled){pointer-events:none}:host(.datetime-button-disabled) button{opacity:0.4}";
12
12
  const IonDatetimeButtonIosStyle0 = iosDatetimeButtonCss;
@@ -40,11 +40,12 @@ const DatetimeButton = class {
40
40
  * to the locale specified on ion-datetime.
41
41
  */
42
42
  this.setDateTimeText = () => {
43
+ var _a, _b, _c, _d, _e;
43
44
  const { datetimeEl, datetimePresentation } = this;
44
45
  if (!datetimeEl) {
45
46
  return;
46
47
  }
47
- const { value, locale, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
48
+ const { value, locale, formatOptions, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
48
49
  const parsedValues = this.getParsedDateValues(value);
49
50
  /**
50
51
  * Both ion-datetime and ion-datetime-button default
@@ -67,8 +68,8 @@ const DatetimeButton = class {
67
68
  switch (datetimePresentation) {
68
69
  case 'date-time':
69
70
  case 'time-date':
70
- const dateText = getMonthDayAndYear(locale, firstParsedDatetime);
71
- const timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
71
+ const dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _a !== void 0 ? _a : { month: 'short', day: 'numeric', year: 'numeric' });
72
+ const timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time);
72
73
  if (preferWheel) {
73
74
  this.dateText = `${dateText} ${timeText}`;
74
75
  }
@@ -91,20 +92,20 @@ const DatetimeButton = class {
91
92
  this.dateText = headerText;
92
93
  }
93
94
  else {
94
- this.dateText = getMonthDayAndYear(locale, firstParsedDatetime);
95
+ this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_b = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _b !== void 0 ? _b : { month: 'short', day: 'numeric', year: 'numeric' });
95
96
  }
96
97
  break;
97
98
  case 'time':
98
- this.timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
99
+ this.timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time);
99
100
  break;
100
101
  case 'month-year':
101
- this.dateText = getMonthAndYear(locale, firstParsedDatetime);
102
+ this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _c !== void 0 ? _c : { month: 'long', year: 'numeric' });
102
103
  break;
103
104
  case 'month':
104
- this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, { month: 'long' });
105
+ this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) !== null && _d !== void 0 ? _d : { month: 'long' });
105
106
  break;
106
107
  case 'year':
107
- this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, { year: 'numeric' });
108
+ this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_e = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) !== null && _e !== void 0 ? _e : { year: 'numeric' });
108
109
  break;
109
110
  }
110
111
  };
@@ -333,7 +334,7 @@ const DatetimeButton = class {
333
334
  render() {
334
335
  const { color, dateText, timeText, selectedButton, datetimeActive, disabled } = this;
335
336
  const mode = getIonMode(this);
336
- return (h(Host, { key: '36fe34d4225940611d74bdef5b954d54749d2dca', class: createColorClasses(color, {
337
+ return (h(Host, { key: '861a08f4a239de771875aee9b505e06ac7064b32', class: createColorClasses(color, {
337
338
  [mode]: true,
338
339
  [`${selectedButton}-active`]: datetimeActive,
339
340
  ['datetime-button-disabled']: disabled,
@@ -9,7 +9,7 @@ import { i as isRTL } from './dir-babeabeb.js';
9
9
  import { c as createColorClasses, g as getClassMap } from './theme-01f3f29c.js';
10
10
  import { c as chevronBack, o as chevronForward, l as chevronDown, p as caretUpSharp, q as caretDownSharp } from './index-f7dc70ba.js';
11
11
  import { b as getIonMode } from './ionic-global-ad9a1810.js';
12
- import { g as generateDayAriaLabel, a as getDay, i as isBefore, b as isAfter, c as isSameDay, d as getPreviousMonth, e as getNextMonth, v as validateParts, f as getPartsFromCalendarDay, h as getNextYear, j as getPreviousYear, k as getEndOfWeek, l as getStartOfWeek, m as getPreviousDay, n as getNextDay, o as getPreviousWeek, p as getNextWeek, q as parseMinParts, r as parseMaxParts, s as parseDate, w as warnIfValueOutOfBounds, t as convertToArrayOfNumbers, u as convertDataToISO, x as getToday, y as getClosestValidDate, z as generateMonths, A as getNumDaysInMonth, B as getCombinedDateColumnData, C as getMonthColumnData, D as getDayColumnData, E as getYearColumnData, F as isMonthFirstLocale, G as getTimeColumnsData, H as isLocaleDayPeriodRTL, I as getDaysOfWeek, J as getMonthAndYear, K as getDaysOfMonth, L as getHourCycle, M as getLocalizedTime, N as getMonthAndDay, O as formatValue, P as clampDate, Q as parseAmPm, R as calculateHourFromAMPM } from './data-0f3ab200.js';
12
+ import { g as generateDayAriaLabel, a as getDay, i as isBefore, b as isAfter, c as isSameDay, d as getPreviousMonth, e as getNextMonth, v as validateParts, f as getPartsFromCalendarDay, h as getNextYear, j as getPreviousYear, k as getEndOfWeek, l as getStartOfWeek, m as getPreviousDay, n as getNextDay, o as getPreviousWeek, p as getNextWeek, q as parseMinParts, r as parseMaxParts, s as parseDate, w as warnIfValueOutOfBounds, t as convertToArrayOfNumbers, u as convertDataToISO, x as getToday, y as getClosestValidDate, z as generateMonths, A as getNumDaysInMonth, B as getCombinedDateColumnData, C as getMonthColumnData, D as getDayColumnData, E as getYearColumnData, F as isMonthFirstLocale, G as getTimeColumnsData, H as isLocaleDayPeriodRTL, I as getDaysOfWeek, J as getMonthAndYear, K as getDaysOfMonth, L as getHourCycle, M as getLocalizedTime, N as getLocalizedDateTime, O as formatValue, P as clampDate, Q as parseAmPm, R as calculateHourFromAMPM } from './data-bb424ba8.js';
13
13
  import { c as createLockController } from './lock-controller-316928be.js';
14
14
  import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-04a9a43f.js';
15
15
  import { c as createAnimation } from './animation-60dbdd13.js';
@@ -186,6 +186,48 @@ const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
186
186
  return undefined;
187
187
  };
188
188
 
189
+ /**
190
+ * If a time zone is provided in the format options, the rendered text could
191
+ * differ from what was selected in the Datetime, which could cause
192
+ * confusion.
193
+ */
194
+ const warnIfTimeZoneProvided = (el, formatOptions) => {
195
+ var _a, _b, _c, _d;
196
+ if (((_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _a === void 0 ? void 0 : _a.timeZone) ||
197
+ ((_b = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _b === void 0 ? void 0 : _b.timeZoneName) ||
198
+ ((_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _c === void 0 ? void 0 : _c.timeZone) ||
199
+ ((_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _d === void 0 ? void 0 : _d.timeZoneName)) {
200
+ printIonWarning('Datetime: "timeZone" and "timeZoneName" are not supported in "formatOptions".', el);
201
+ }
202
+ };
203
+ const checkForPresentationFormatMismatch = (el, presentation, formatOptions) => {
204
+ // formatOptions is not required
205
+ if (!formatOptions)
206
+ return;
207
+ // If formatOptions is provided, the date and/or time objects are required, depending on the presentation
208
+ switch (presentation) {
209
+ case 'date':
210
+ case 'month-year':
211
+ case 'month':
212
+ case 'year':
213
+ if (formatOptions.date === undefined) {
214
+ printIonWarning(`Datetime: The '${presentation}' presentation requires a date object in formatOptions.`, el);
215
+ }
216
+ break;
217
+ case 'time':
218
+ if (formatOptions.time === undefined) {
219
+ printIonWarning(`Datetime: The 'time' presentation requires a time object in formatOptions.`, el);
220
+ }
221
+ break;
222
+ case 'date-time':
223
+ case 'time-date':
224
+ if (formatOptions.date === undefined && formatOptions.time === undefined) {
225
+ printIonWarning(`Datetime: The '${presentation}' presentation requires either a date or time object (or both) in formatOptions.`, el);
226
+ }
227
+ break;
228
+ }
229
+ };
230
+
189
231
  const datetimeIosCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{left:-99999px}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){:host(.show-month-and-year:dir(rtl)) .calendar-next-prev,:host(.show-month-and-year:dir(rtl)) .calendar-days-of-week,:host(.show-month-and-year:dir(rtl)) .calendar-body,:host(.show-month-and-year:dir(rtl)) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:auto}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #666666)}:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, #cccccc);font-size:min(0.875rem, 22.4px)}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}:host .calendar-action-buttons ion-item{--padding-start:16px;--background-hover:transparent;--background-activated:transparent;font-size:min(1rem, 25.6px);font-weight:600}:host .calendar-action-buttons ion-item ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:0}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, #b3b3b3);font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){.calendar-days-of-week .day-of-week{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}.calendar-day{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){.calendar-days-of-week .day-of-week{width:auto;height:auto;overflow:initial}.calendar-day{border-radius:32px}}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}:host .calendar-day-wrapper{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}:host .calendar-day{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}.calendar-day.calendar-day-active{background:rgba(var(--ion-color-base-rgb), 0.2)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, #cccccc)}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}";
190
232
  const IonDatetimeIosStyle0 = datetimeIosCss;
191
233
 
@@ -810,6 +852,7 @@ const Datetime = class {
810
852
  this.color = 'primary';
811
853
  this.name = this.inputId;
812
854
  this.disabled = false;
855
+ this.formatOptions = undefined;
813
856
  this.readonly = false;
814
857
  this.isDateEnabled = undefined;
815
858
  this.min = undefined;
@@ -837,6 +880,11 @@ const Datetime = class {
837
880
  this.size = 'fixed';
838
881
  this.preferWheel = false;
839
882
  }
883
+ formatOptionsChanged() {
884
+ const { el, formatOptions, presentation } = this;
885
+ checkForPresentationFormatMismatch(el, presentation, formatOptions);
886
+ warnIfTimeZoneProvided(el, formatOptions);
887
+ }
840
888
  disabledChanged() {
841
889
  this.emitStyle();
842
890
  }
@@ -846,6 +894,10 @@ const Datetime = class {
846
894
  maxChanged() {
847
895
  this.processMaxParts();
848
896
  }
897
+ presentationChanged() {
898
+ const { el, formatOptions, presentation } = this;
899
+ checkForPresentationFormatMismatch(el, presentation, formatOptions);
900
+ }
849
901
  get isGridStyle() {
850
902
  const { presentation, preferWheel } = this;
851
903
  const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
@@ -1081,7 +1133,7 @@ const Datetime = class {
1081
1133
  });
1082
1134
  }
1083
1135
  componentWillLoad() {
1084
- const { el, highlightedDates, multiple, presentation, preferWheel } = this;
1136
+ const { el, formatOptions, highlightedDates, multiple, presentation, preferWheel } = this;
1085
1137
  if (multiple) {
1086
1138
  if (presentation !== 'date') {
1087
1139
  printIonWarning('Multiple date selection is only supported for presentation="date".', el);
@@ -1098,6 +1150,10 @@ const Datetime = class {
1098
1150
  printIonWarning('The highlightedDates property is not supported with preferWheel="true".', el);
1099
1151
  }
1100
1152
  }
1153
+ if (formatOptions) {
1154
+ checkForPresentationFormatMismatch(el, presentation, formatOptions);
1155
+ warnIfTimeZoneProvided(el, formatOptions);
1156
+ }
1101
1157
  const hourValues = (this.parsedHourValues = convertToArrayOfNumbers(this.hourValues));
1102
1158
  const minuteValues = (this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues));
1103
1159
  const monthValues = (this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues));
@@ -1605,7 +1661,7 @@ const Datetime = class {
1605
1661
  return h("slot", { name: "time-label" }, "Time");
1606
1662
  }
1607
1663
  renderTimeOverlay() {
1608
- const { disabled, hourCycle, isTimePopoverOpen, locale } = this;
1664
+ const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
1609
1665
  const computedHourCycle = getHourCycle(locale, hourCycle);
1610
1666
  const activePart = this.getActivePartsWithFallback();
1611
1667
  return [
@@ -1625,7 +1681,7 @@ const Datetime = class {
1625
1681
  await popoverRef.onWillDismiss();
1626
1682
  this.isTimePopoverOpen = false;
1627
1683
  }
1628
- } }, getLocalizedTime(locale, activePart, computedHourCycle)),
1684
+ } }, getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
1629
1685
  h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
1630
1686
  /**
1631
1687
  * Intersection Observers do not consistently fire between Blink and Webkit
@@ -1648,7 +1704,8 @@ const Datetime = class {
1648
1704
  ];
1649
1705
  }
1650
1706
  getHeaderSelectedDateText() {
1651
- const { activeParts, multiple, titleSelectedDatesFormatter } = this;
1707
+ var _a;
1708
+ const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
1652
1709
  const isArray = Array.isArray(activeParts);
1653
1710
  let headerText;
1654
1711
  if (multiple && isArray && activeParts.length !== 1) {
@@ -1664,7 +1721,7 @@ const Datetime = class {
1664
1721
  }
1665
1722
  else {
1666
1723
  // for exactly 1 day selected (multiple set or not), show a formatted version of that
1667
- headerText = getMonthAndDay(this.locale, this.getActivePartsWithFallback());
1724
+ headerText = getLocalizedDateTime(this.locale, this.getActivePartsWithFallback(), (_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _a !== void 0 ? _a : { weekday: 'short', month: 'short', day: 'numeric' });
1668
1725
  }
1669
1726
  return headerText;
1670
1727
  }
@@ -1753,7 +1810,7 @@ const Datetime = class {
1753
1810
  const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1754
1811
  const hasWheelVariant = hasDatePresentation && preferWheel;
1755
1812
  renderHiddenInput(true, el, name, formatValue(value), disabled);
1756
- return (h(Host, { key: 'b00545b7bbba3ccf35d53c1eec4f1614fb830c11', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
1813
+ return (h(Host, { key: 'b12b07aebad0a686f93f70dbe29bd039b4c4104f', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
1757
1814
  [mode]: true,
1758
1815
  ['datetime-readonly']: readonly,
1759
1816
  ['datetime-disabled']: disabled,
@@ -1767,9 +1824,11 @@ const Datetime = class {
1767
1824
  }
1768
1825
  get el() { return getElement(this); }
1769
1826
  static get watchers() { return {
1827
+ "formatOptions": ["formatOptionsChanged"],
1770
1828
  "disabled": ["disabledChanged"],
1771
1829
  "min": ["minChanged"],
1772
1830
  "max": ["maxChanged"],
1831
+ "presentation": ["presentationChanged"],
1773
1832
  "yearValues": ["yearValuesChanged"],
1774
1833
  "monthValues": ["monthValuesChanged"],
1775
1834
  "dayValues": ["dayValuesChanged"],