@datum-cloud/activity-ui 0.7.1-dev.12ee821 → 0.7.1-dev.1ce6c58
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/dist/index.esm.js +19 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.esm.js
CHANGED
|
@@ -702,6 +702,19 @@ function toDate(argument, context) {
|
|
|
702
702
|
* @description
|
|
703
703
|
* Add the specified number of days to the given date.
|
|
704
704
|
*
|
|
705
|
+
* **You don't need date-fns\***:
|
|
706
|
+
*
|
|
707
|
+
* Temporal has a built-in `add` method on all its classes:
|
|
708
|
+
*
|
|
709
|
+
* - [`Temporal.Instant.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Instant/add)
|
|
710
|
+
* - [`Temporal.PlainDate.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDate/add)
|
|
711
|
+
* - [`Temporal.PlainDateTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDateTime/add)
|
|
712
|
+
* - [`Temporal.PlainTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainTime/add)
|
|
713
|
+
* - [`Temporal.PlainYearMonth.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainYearMonth/add)
|
|
714
|
+
* - [`Temporal.ZonedDateTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime/add)
|
|
715
|
+
*
|
|
716
|
+
* \* **Not really**, see: https://date-fns.org/you-dont-need-date-fns
|
|
717
|
+
*
|
|
705
718
|
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
706
719
|
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
707
720
|
*
|
|
@@ -715,6 +728,12 @@ function toDate(argument, context) {
|
|
|
715
728
|
* // Add 10 days to 1 September 2014:
|
|
716
729
|
* const result = addDays(new Date(2014, 8, 1), 10)
|
|
717
730
|
* //=> Thu Sep 11 2014 00:00:00
|
|
731
|
+
*
|
|
732
|
+
* @example
|
|
733
|
+
* // Using Temporal:
|
|
734
|
+
* // Add 10 days to 1 September 2014:
|
|
735
|
+
* Temporal.PlainDate.from("2014-09-01").add({ days: 10 }).toString();
|
|
736
|
+
* //=> "2014-09-11"
|
|
718
737
|
*/
|
|
719
738
|
function addDays(date, amount, options) {
|
|
720
739
|
const _date = toDate(date, options?.in);
|