@opengeoweb/shared 9.26.0 → 9.27.0

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/index.esm.js CHANGED
@@ -10,7 +10,7 @@ import Draggable from 'react-draggable';
10
10
  import { Resizable } from 're-resizable';
11
11
  import * as Sentry from '@sentry/react';
12
12
  import { useStore } from 'react-redux';
13
- import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$3, getHours as getHours$1, startOfDay, addMinutes, addHours, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
13
+ import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, roundToNearestMinutes as roundToNearestMinutes$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$3, getHours as getHours$1, startOfDay, addMinutes, addHours, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
14
14
  import configureStore from 'redux-mock-store';
15
15
  import { configureStore as configureStore$1 } from '@reduxjs/toolkit';
16
16
 
@@ -9029,6 +9029,15 @@ const differenceInHours = (dateLeft, dateRight, roundingMethod) => {
9029
9029
  const differenceInSeconds = (dateLeft, dateRight) => {
9030
9030
  return differenceInSeconds$1(dateLeft, dateRight);
9031
9031
  };
9032
+ /**
9033
+ *
9034
+ * @param date - the date to be rounded
9035
+ * @param options - the options for rounding
9036
+ * @returns the new date
9037
+ */
9038
+ const roundToNearestMinutes = (date, options) => {
9039
+ return roundToNearestMinutes$1(date, options);
9040
+ };
9032
9041
  /**
9033
9042
  *
9034
9043
  * @param date - the date that should be before the other one to return true
@@ -9374,6 +9383,7 @@ var index = /*#__PURE__*/Object.freeze({
9374
9383
  isoStringToDate: isoStringToDate,
9375
9384
  parseCustomDateString: parseCustomDateString,
9376
9385
  parseISO: parseISO,
9386
+ roundToNearestMinutes: roundToNearestMinutes,
9377
9387
  set: set,
9378
9388
  setUTCDate: setUTCDate,
9379
9389
  startOfDay: startOfDay,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "9.26.0",
3
+ "version": "9.27.0",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -24,7 +24,9 @@
24
24
  "@sentry/react": "^7.109.0"
25
25
  },
26
26
  "peerDependencies": {
27
- "react": "18"
27
+ "react": "18",
28
+ "@emotion/react": "*",
29
+ "@emotion/styled": "*"
28
30
  },
29
31
  "module": "./index.esm.js",
30
32
  "type": "module",
@@ -1,4 +1,4 @@
1
- import { parseISO, isEqual, Duration, startOfDay, isWithinInterval, getDayOfYear, getDay, getMonth, getYear, getWeek } from 'date-fns';
1
+ import { parseISO, isEqual, Duration, startOfDay, isWithinInterval, getDayOfYear, getDay, getMonth, getYear, getWeek, NearestMinutes } from 'date-fns';
2
2
  export interface DateValues {
3
3
  year?: number;
4
4
  month?: number;
@@ -206,6 +206,15 @@ export declare const differenceInHours: (dateLeft: Date | number, dateRight: Dat
206
206
  * @returns {number} the number of minutes
207
207
  */
208
208
  export declare const differenceInSeconds: (dateLeft: Date | number, dateRight: Date | number) => number;
209
+ /**
210
+ *
211
+ * @param date - the date to be rounded
212
+ * @param options - the options for rounding
213
+ * @returns the new date
214
+ */
215
+ export declare const roundToNearestMinutes: (date: Date | number, options: {
216
+ nearestTo: NearestMinutes;
217
+ }) => Date;
209
218
  /**
210
219
  *
211
220
  * @param date - the date that should be before the other one to return true