@openmrs/esm-framework 3.1.15-pre.718 → 3.1.15-pre.722

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.
package/docs/API.md CHANGED
@@ -112,6 +112,7 @@
112
112
  - [CurrentPatient](API.md#currentpatient)
113
113
  - [DateInput](API.md#dateinput)
114
114
  - [ExtensionSlotProps](API.md#extensionslotprops)
115
+ - [FormatDateMode](API.md#formatdatemode)
115
116
  - [KnownOmrsServiceWorkerEvents](API.md#knownomrsserviceworkerevents)
116
117
  - [KnownOmrsServiceWorkerMessages](API.md#knownomrsserviceworkermessages)
117
118
  - [LayoutType](API.md#layouttype)
@@ -200,6 +201,9 @@
200
201
  - [dispatchNetworkRequestFailed](API.md#dispatchnetworkrequestfailed)
201
202
  - [dispatchNotificationShown](API.md#dispatchnotificationshown)
202
203
  - [dispatchPrecacheStaticDependencies](API.md#dispatchprecachestaticdependencies)
204
+ - [formatDate](API.md#formatdate)
205
+ - [formatDatetime](API.md#formatdatetime)
206
+ - [formatTime](API.md#formattime)
203
207
  - [generateOfflineUuid](API.md#generateofflineuuid)
204
208
  - [getAppState](API.md#getappstate)
205
209
  - [getAssignedIds](API.md#getassignedids)
@@ -373,7 +377,7 @@ ___
373
377
 
374
378
  #### Defined in
375
379
 
376
- [packages/framework/esm-utils/src/omrs-dates.ts:8](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L8)
380
+ [packages/framework/esm-utils/src/omrs-dates.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L19)
377
381
 
378
382
  ___
379
383
 
@@ -387,6 +391,16 @@ ___
387
391
 
388
392
  ___
389
393
 
394
+ ### FormatDateMode
395
+
396
+ Ƭ **FormatDateMode**: ``"standard"`` \| ``"no year"`` \| ``"no day"`` \| ``"wide"``
397
+
398
+ #### Defined in
399
+
400
+ [packages/framework/esm-utils/src/omrs-dates.ts:146](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L146)
401
+
402
+ ___
403
+
390
404
  ### KnownOmrsServiceWorkerEvents
391
405
 
392
406
  Ƭ **KnownOmrsServiceWorkerEvents**: [`NetworkRequestFailedEvent`](interfaces/NetworkRequestFailedEvent.md)
@@ -1689,6 +1703,87 @@ ___
1689
1703
 
1690
1704
  ___
1691
1705
 
1706
+ ### formatDate
1707
+
1708
+ ▸ **formatDate**(`date`, `mode?`): `string`
1709
+
1710
+ Formats the input date according to the current locale and the
1711
+ given format mode.
1712
+
1713
+ `standard`: "13 Dec 2021"
1714
+ `no year`: "13 Dec"
1715
+ `no day`: "Dec 2021"
1716
+ `wide`: "13 — Dec — 2021"
1717
+
1718
+ #### Parameters
1719
+
1720
+ | Name | Type | Default value |
1721
+ | :------ | :------ | :------ |
1722
+ | `date` | `Date` | `undefined` |
1723
+ | `mode` | [`FormatDateMode`](API.md#formatdatemode) | `"standard"` |
1724
+
1725
+ #### Returns
1726
+
1727
+ `string`
1728
+
1729
+ #### Defined in
1730
+
1731
+ [packages/framework/esm-utils/src/omrs-dates.ts:157](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L157)
1732
+
1733
+ ___
1734
+
1735
+ ### formatDatetime
1736
+
1737
+ ▸ **formatDatetime**(`date`, `mode?`): `string`
1738
+
1739
+ Formats the input into a string showing the date and time, according
1740
+ to the current locale. The `mode` parameter is as described for
1741
+ `formatDate`.
1742
+
1743
+ This is created by concatenating the results of `formatDate`
1744
+ and `formatTime` with a comma and space. This agrees with the
1745
+ output of `Date.prototype.toLocaleString` for *most* locales.
1746
+
1747
+ #### Parameters
1748
+
1749
+ | Name | Type | Default value |
1750
+ | :------ | :------ | :------ |
1751
+ | `date` | `Date` | `undefined` |
1752
+ | `mode` | [`FormatDateMode`](API.md#formatdatemode) | `"standard"` |
1753
+
1754
+ #### Returns
1755
+
1756
+ `string`
1757
+
1758
+ #### Defined in
1759
+
1760
+ [packages/framework/esm-utils/src/omrs-dates.ts:219](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L219)
1761
+
1762
+ ___
1763
+
1764
+ ### formatTime
1765
+
1766
+ ▸ **formatTime**(`date`): `string`
1767
+
1768
+ Formats the input as a time, according to the current locale.
1769
+ 12-hour or 24-hour clock depends on locale.
1770
+
1771
+ #### Parameters
1772
+
1773
+ | Name | Type |
1774
+ | :------ | :------ |
1775
+ | `date` | `Date` |
1776
+
1777
+ #### Returns
1778
+
1779
+ `string`
1780
+
1781
+ #### Defined in
1782
+
1783
+ [packages/framework/esm-utils/src/omrs-dates.ts:203](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L203)
1784
+
1785
+ ___
1786
+
1692
1787
  ### generateOfflineUuid
1693
1788
 
1694
1789
  ▸ **generateOfflineUuid**(): `string`
@@ -2409,7 +2504,7 @@ The format should be YYYY-MM-DDTHH:mm:ss.SSSZZ
2409
2504
 
2410
2505
  #### Defined in
2411
2506
 
2412
- [packages/framework/esm-utils/src/omrs-dates.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L16)
2507
+ [packages/framework/esm-utils/src/omrs-dates.ts:27](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L27)
2413
2508
 
2414
2509
  ___
2415
2510
 
@@ -2429,7 +2524,7 @@ ___
2429
2524
 
2430
2525
  #### Defined in
2431
2526
 
2432
- [packages/framework/esm-utils/src/omrs-dates.ts:53](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L53)
2527
+ [packages/framework/esm-utils/src/omrs-dates.ts:64](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L64)
2433
2528
 
2434
2529
  ___
2435
2530
 
@@ -3459,7 +3554,7 @@ Converts the object to a date object if it is a valid ISO date time string.
3459
3554
 
3460
3555
  #### Defined in
3461
3556
 
3462
- [packages/framework/esm-utils/src/omrs-dates.ts:60](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L60)
3557
+ [packages/framework/esm-utils/src/omrs-dates.ts:71](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L71)
3463
3558
 
3464
3559
  ___
3465
3560
 
@@ -3487,6 +3582,7 @@ ___
3487
3582
 
3488
3583
  ▸ **toOmrsDateFormat**(`date`, `format?`): `string`
3489
3584
 
3585
+ **`deprecated`** use `formatDate(date)`
3490
3586
  Formats the input as a date string. By default the format "YYYY-MMM-DD" is used.
3491
3587
 
3492
3588
  #### Parameters
@@ -3502,7 +3598,7 @@ Formats the input as a date string. By default the format "YYYY-MMM-DD" is used.
3502
3598
 
3503
3599
  #### Defined in
3504
3600
 
3505
- [packages/framework/esm-utils/src/omrs-dates.ts:112](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L112)
3601
+ [packages/framework/esm-utils/src/omrs-dates.ts:128](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L128)
3506
3602
 
3507
3603
  ___
3508
3604
 
@@ -3510,6 +3606,7 @@ ___
3510
3606
 
3511
3607
  ▸ **toOmrsDayDateFormat**(`date`): `string`
3512
3608
 
3609
+ **`deprecated`** use `formatDate(date, "wide")`
3513
3610
  Formats the input as a date string using the format "DD - MMM - YYYY".
3514
3611
 
3515
3612
  #### Parameters
@@ -3524,7 +3621,7 @@ Formats the input as a date string using the format "DD - MMM - YYYY".
3524
3621
 
3525
3622
  #### Defined in
3526
3623
 
3527
- [packages/framework/esm-utils/src/omrs-dates.ts:98](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L98)
3624
+ [packages/framework/esm-utils/src/omrs-dates.ts:112](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L112)
3528
3625
 
3529
3626
  ___
3530
3627
 
@@ -3547,7 +3644,7 @@ Formats the input as a date time string using the format "YYYY-MM-DDTHH:mm:ss.SS
3547
3644
 
3548
3645
  #### Defined in
3549
3646
 
3550
- [packages/framework/esm-utils/src/omrs-dates.ts:71](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L71)
3647
+ [packages/framework/esm-utils/src/omrs-dates.ts:82](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L82)
3551
3648
 
3552
3649
  ___
3553
3650
 
@@ -3555,6 +3652,7 @@ ___
3555
3652
 
3556
3653
  ▸ **toOmrsTimeString**(`date`): `string`
3557
3654
 
3655
+ **`deprecated`** use `formatTime`
3558
3656
  Formats the input as a time string using the format "HH:mm A".
3559
3657
 
3560
3658
  #### Parameters
@@ -3569,7 +3667,7 @@ Formats the input as a time string using the format "HH:mm A".
3569
3667
 
3570
3668
  #### Defined in
3571
3669
 
3572
- [packages/framework/esm-utils/src/omrs-dates.ts:91](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L91)
3670
+ [packages/framework/esm-utils/src/omrs-dates.ts:104](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L104)
3573
3671
 
3574
3672
  ___
3575
3673
 
@@ -3577,6 +3675,7 @@ ___
3577
3675
 
3578
3676
  ▸ **toOmrsTimeString24**(`date`): `string`
3579
3677
 
3678
+ **`deprecated`** use `formatTime`
3580
3679
  Formats the input as a time string using the format "HH:mm".
3581
3680
 
3582
3681
  #### Parameters
@@ -3591,7 +3690,7 @@ Formats the input as a time string using the format "HH:mm".
3591
3690
 
3592
3691
  #### Defined in
3593
3692
 
3594
- [packages/framework/esm-utils/src/omrs-dates.ts:84](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L84)
3693
+ [packages/framework/esm-utils/src/omrs-dates.ts:96](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L96)
3595
3694
 
3596
3695
  ___
3597
3696
 
@@ -3599,6 +3698,7 @@ ___
3599
3698
 
3600
3699
  ▸ **toOmrsYearlessDateFormat**(`date`): `string`
3601
3700
 
3701
+ **`deprecated`** use `formatDate(date, "no year")`
3602
3702
  Formats the input as a date string using the format "DD-MMM".
3603
3703
 
3604
3704
  #### Parameters
@@ -3613,7 +3713,7 @@ Formats the input as a date string using the format "DD-MMM".
3613
3713
 
3614
3714
  #### Defined in
3615
3715
 
3616
- [packages/framework/esm-utils/src/omrs-dates.ts:105](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L105)
3716
+ [packages/framework/esm-utils/src/omrs-dates.ts:120](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L120)
3617
3717
 
3618
3718
  ___
3619
3719
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-framework",
3
- "version": "3.1.15-pre.718",
3
+ "version": "3.1.15-pre.722",
4
4
  "license": "MPL-2.0",
5
5
  "browser": "dist/openmrs-esm-framework.js",
6
6
  "main": "src/index.ts",
@@ -35,17 +35,17 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@openmrs/esm-api": "^3.1.15-pre.718",
39
- "@openmrs/esm-breadcrumbs": "^3.1.15-pre.718",
40
- "@openmrs/esm-config": "^3.1.15-pre.718",
41
- "@openmrs/esm-error-handling": "^3.1.15-pre.718",
42
- "@openmrs/esm-extensions": "^3.1.15-pre.718",
43
- "@openmrs/esm-globals": "^3.1.15-pre.718",
44
- "@openmrs/esm-offline": "^3.1.15-pre.718",
45
- "@openmrs/esm-react-utils": "^3.1.15-pre.718",
46
- "@openmrs/esm-state": "^3.1.15-pre.718",
47
- "@openmrs/esm-styleguide": "^3.1.15-pre.718",
48
- "@openmrs/esm-utils": "^3.1.15-pre.718"
38
+ "@openmrs/esm-api": "^3.1.15-pre.722",
39
+ "@openmrs/esm-breadcrumbs": "^3.1.15-pre.722",
40
+ "@openmrs/esm-config": "^3.1.15-pre.722",
41
+ "@openmrs/esm-error-handling": "^3.1.15-pre.722",
42
+ "@openmrs/esm-extensions": "^3.1.15-pre.722",
43
+ "@openmrs/esm-globals": "^3.1.15-pre.722",
44
+ "@openmrs/esm-offline": "^3.1.15-pre.722",
45
+ "@openmrs/esm-react-utils": "^3.1.15-pre.722",
46
+ "@openmrs/esm-state": "^3.1.15-pre.722",
47
+ "@openmrs/esm-styleguide": "^3.1.15-pre.722",
48
+ "@openmrs/esm-utils": "^3.1.15-pre.722"
49
49
  },
50
- "gitHead": "4f30619d9e3db89532aafd059d9d12740782501b"
50
+ "gitHead": "dc5e1f29f3e0c62053c536977b4c1264b585d261"
51
51
  }