@h3ravel/support 0.14.4 → 0.15.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/dist/index.cjs +10 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +10 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1559,6 +1559,15 @@ var DateTime = class DateTime extends TimeClass {
|
|
|
1559
1559
|
return this.startOf(unit);
|
|
1560
1560
|
}
|
|
1561
1561
|
/**
|
|
1562
|
+
* Set the timezone for the instance
|
|
1563
|
+
*
|
|
1564
|
+
* @param timezone
|
|
1565
|
+
* @returns
|
|
1566
|
+
*/
|
|
1567
|
+
setTimezone(timezone$1, keepLocalTime) {
|
|
1568
|
+
return new DateTime(this.tz(timezone$1, keepLocalTime));
|
|
1569
|
+
}
|
|
1570
|
+
/**
|
|
1562
1571
|
* End time of a specific unit.
|
|
1563
1572
|
*
|
|
1564
1573
|
* @returns
|
|
@@ -1613,7 +1622,7 @@ var DateTime = class DateTime extends TimeClass {
|
|
|
1613
1622
|
* @return {Date} object
|
|
1614
1623
|
*/
|
|
1615
1624
|
static fromTimestamp(timestamp) {
|
|
1616
|
-
return
|
|
1625
|
+
return new DateTime(timestamp * 1e3);
|
|
1617
1626
|
}
|
|
1618
1627
|
/**
|
|
1619
1628
|
* Get current time instance.
|
package/dist/index.d.cts
CHANGED
|
@@ -484,7 +484,7 @@ declare class Arr {
|
|
|
484
484
|
* Arr.divide(['a','b']) -> [[0,1], ['a','b']]
|
|
485
485
|
* Arr.divide({x:1,y:2}) -> [['x','y'], [1,2]]
|
|
486
486
|
*/
|
|
487
|
-
static divide<A>(input: A[] | Record<string, A>): (
|
|
487
|
+
static divide<A>(input: A[] | Record<string, A>): (A[] | number[])[] | (A[] | string[])[];
|
|
488
488
|
/**
|
|
489
489
|
* Flatten a nested array/object structure into a single-level object
|
|
490
490
|
* with dot-notated keys.
|
|
@@ -835,6 +835,13 @@ declare class DateTime extends TimeClass {
|
|
|
835
835
|
* @returns
|
|
836
836
|
*/
|
|
837
837
|
start(unit?: OpUnitType): dayjs.Dayjs;
|
|
838
|
+
/**
|
|
839
|
+
* Set the timezone for the instance
|
|
840
|
+
*
|
|
841
|
+
* @param timezone
|
|
842
|
+
* @returns
|
|
843
|
+
*/
|
|
844
|
+
setTimezone(timezone?: string | undefined, keepLocalTime?: boolean | undefined): DateTime;
|
|
838
845
|
/**
|
|
839
846
|
* End time of a specific unit.
|
|
840
847
|
*
|
|
@@ -871,7 +878,7 @@ declare class DateTime extends TimeClass {
|
|
|
871
878
|
*
|
|
872
879
|
* @return {Date} object
|
|
873
880
|
*/
|
|
874
|
-
static fromTimestamp(timestamp: number):
|
|
881
|
+
static fromTimestamp(timestamp: number): DateTime;
|
|
875
882
|
/**
|
|
876
883
|
* Get current time instance.
|
|
877
884
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -482,7 +482,7 @@ declare class Arr {
|
|
|
482
482
|
* Arr.divide(['a','b']) -> [[0,1], ['a','b']]
|
|
483
483
|
* Arr.divide({x:1,y:2}) -> [['x','y'], [1,2]]
|
|
484
484
|
*/
|
|
485
|
-
static divide<A>(input: A[] | Record<string, A>): (
|
|
485
|
+
static divide<A>(input: A[] | Record<string, A>): (A[] | number[])[] | (A[] | string[])[];
|
|
486
486
|
/**
|
|
487
487
|
* Flatten a nested array/object structure into a single-level object
|
|
488
488
|
* with dot-notated keys.
|
|
@@ -833,6 +833,13 @@ declare class DateTime extends TimeClass {
|
|
|
833
833
|
* @returns
|
|
834
834
|
*/
|
|
835
835
|
start(unit?: OpUnitType): dayjs.Dayjs;
|
|
836
|
+
/**
|
|
837
|
+
* Set the timezone for the instance
|
|
838
|
+
*
|
|
839
|
+
* @param timezone
|
|
840
|
+
* @returns
|
|
841
|
+
*/
|
|
842
|
+
setTimezone(timezone?: string | undefined, keepLocalTime?: boolean | undefined): DateTime;
|
|
836
843
|
/**
|
|
837
844
|
* End time of a specific unit.
|
|
838
845
|
*
|
|
@@ -869,7 +876,7 @@ declare class DateTime extends TimeClass {
|
|
|
869
876
|
*
|
|
870
877
|
* @return {Date} object
|
|
871
878
|
*/
|
|
872
|
-
static fromTimestamp(timestamp: number):
|
|
879
|
+
static fromTimestamp(timestamp: number): DateTime;
|
|
873
880
|
/**
|
|
874
881
|
* Get current time instance.
|
|
875
882
|
*
|
package/dist/index.js
CHANGED
|
@@ -1517,6 +1517,15 @@ var DateTime = class DateTime extends TimeClass {
|
|
|
1517
1517
|
return this.startOf(unit);
|
|
1518
1518
|
}
|
|
1519
1519
|
/**
|
|
1520
|
+
* Set the timezone for the instance
|
|
1521
|
+
*
|
|
1522
|
+
* @param timezone
|
|
1523
|
+
* @returns
|
|
1524
|
+
*/
|
|
1525
|
+
setTimezone(timezone$1, keepLocalTime) {
|
|
1526
|
+
return new DateTime(this.tz(timezone$1, keepLocalTime));
|
|
1527
|
+
}
|
|
1528
|
+
/**
|
|
1520
1529
|
* End time of a specific unit.
|
|
1521
1530
|
*
|
|
1522
1531
|
* @returns
|
|
@@ -1571,7 +1580,7 @@ var DateTime = class DateTime extends TimeClass {
|
|
|
1571
1580
|
* @return {Date} object
|
|
1572
1581
|
*/
|
|
1573
1582
|
static fromTimestamp(timestamp) {
|
|
1574
|
-
return
|
|
1583
|
+
return new DateTime(timestamp * 1e3);
|
|
1575
1584
|
}
|
|
1576
1585
|
/**
|
|
1577
1586
|
* Get current time instance.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/support",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Shared helpers, facades and utilities for H3ravel.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/luxon": "^3.7.1",
|
|
40
40
|
"typescript": "^5.4.0",
|
|
41
|
-
"@h3ravel/shared": "^0.
|
|
41
|
+
"@h3ravel/shared": "^0.27.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"dayjs": "^1.11.18",
|