@koine/next 1.1.2 → 1.1.4
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/node/useDateFormat.js +2 -2
- package/package.json +5 -5
- package/useDateFormat.js +1 -1
package/node/useDateFormat.js
CHANGED
|
@@ -5,7 +5,7 @@ var tslib_1 = require("tslib");
|
|
|
5
5
|
var react_1 = require("react");
|
|
6
6
|
var router_1 = require("next/router");
|
|
7
7
|
var format_1 = tslib_1.__importDefault(require("date-fns/format"));
|
|
8
|
-
var
|
|
8
|
+
var hooks_1 = require("@koine/react/hooks");
|
|
9
9
|
/**
|
|
10
10
|
* Automatically returns the `date-fns/format` function with the right locale
|
|
11
11
|
* passed as option (grabbed from next router value).
|
|
@@ -21,7 +21,7 @@ var useDateFormat = function () {
|
|
|
21
21
|
};
|
|
22
22
|
}), formatter = _a[0], setFormatter = _a[1];
|
|
23
23
|
var router = (0, router_1.useRouter)();
|
|
24
|
-
var locale = (0,
|
|
24
|
+
var locale = (0, hooks_1.useDateLocale)(router.locale);
|
|
25
25
|
(0, react_1.useEffect)(function () {
|
|
26
26
|
if (locale) {
|
|
27
27
|
var newFormatter_1 = function (date, _format, options) { return (0, format_1.default)(date, _format, tslib_1.__assign(tslib_1.__assign({}, (options || {})), { locale: locale })); };
|
package/package.json
CHANGED
|
@@ -63,13 +63,13 @@
|
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"react": "18.2.0",
|
|
65
65
|
"next": "13.1.6",
|
|
66
|
-
"@koine/browser": "1.1.
|
|
67
|
-
"@koine/utils": "1.1.
|
|
66
|
+
"@koine/browser": "1.1.4",
|
|
67
|
+
"@koine/utils": "1.1.4",
|
|
68
68
|
"ts-debounce": "4.0.0",
|
|
69
69
|
"type-fest": "3.5.3",
|
|
70
|
-
"@koine/dom": "1.1.
|
|
70
|
+
"@koine/dom": "1.1.4",
|
|
71
71
|
"date-fns-tz": "1.3.7",
|
|
72
|
-
"framer-motion": "
|
|
72
|
+
"framer-motion": "8.5.5",
|
|
73
73
|
"next-auth": "4.19.0",
|
|
74
74
|
"@mui/material": "5.11.6",
|
|
75
75
|
"@emotion/react": "11.10.5",
|
|
@@ -83,6 +83,6 @@
|
|
|
83
83
|
"@hookform/resolvers": "2.9.10",
|
|
84
84
|
"tslib": "2.5.0"
|
|
85
85
|
},
|
|
86
|
-
"version": "1.1.
|
|
86
|
+
"version": "1.1.4",
|
|
87
87
|
"module": "./index.js"
|
|
88
88
|
}
|
package/useDateFormat.js
CHANGED
|
@@ -2,7 +2,7 @@ import { __assign } from "tslib";
|
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { useRouter } from "next/router";
|
|
4
4
|
import format from "date-fns/format";
|
|
5
|
-
import useDateLocale from "@koine/react/hooks
|
|
5
|
+
import { useDateLocale } from "@koine/react/hooks";
|
|
6
6
|
/**
|
|
7
7
|
* Automatically returns the `date-fns/format` function with the right locale
|
|
8
8
|
* passed as option (grabbed from next router value).
|