@uxf/localize 11.63.0 → 11.78.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/localize",
3
- "version": "11.63.0",
3
+ "version": "11.78.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,7 @@
1
+ import dayjs, { ConfigType, Dayjs, OptionType } from "dayjs";
2
+ import { TimeZone } from "../utils/time-zone";
3
+ export declare function dayjsTz(date?: ConfigType, format?: OptionType, strict?: boolean, tz?: TimeZone): Dayjs;
4
+ export declare const nowDayjs: (tz?: TimeZone) => dayjs.Dayjs;
5
+ export declare const now: (tz?: TimeZone) => Date;
6
+ export declare const todayDayjs: (tz?: TimeZone) => dayjs.Dayjs;
7
+ export declare const today: (tz?: TimeZone) => Date;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.today = exports.todayDayjs = exports.now = exports.nowDayjs = void 0;
30
+ exports.dayjsTz = dayjsTz;
31
+ const dayjs_1 = __importStar(require("dayjs"));
32
+ const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
33
+ (0, dayjs_1.extend)(timezone_1.default);
34
+ function dayjsTz(date, format, strict, tz = "Europe/Prague") {
35
+ const d = dayjs_1.default.tz(date, tz);
36
+ return (0, dayjs_1.default)(d, format, strict);
37
+ }
38
+ const nowDayjs = (tz) => dayjsTz(undefined, undefined, undefined, tz);
39
+ exports.nowDayjs = nowDayjs;
40
+ const now = (tz) => (0, exports.nowDayjs)(tz).toDate();
41
+ exports.now = now;
42
+ const todayDayjs = (tz) => dayjsTz(undefined, undefined, undefined, tz).startOf("date");
43
+ exports.todayDayjs = todayDayjs;
44
+ const today = (tz) => (0, exports.todayDayjs)(tz).toDate();
45
+ exports.today = today;