bkper-js 1.46.1 → 1.47.1
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/lib/index.d.ts +9 -1
- package/lib/model/Transaction.js +14 -2
- package/lib/utils.js +2 -4
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -2763,9 +2763,17 @@ export declare class Transaction {
|
|
|
2763
2763
|
*/
|
|
2764
2764
|
getCreatedAt(): Date;
|
|
2765
2765
|
/**
|
|
2766
|
-
* @returns The date the transaction was created, formatted according to the date pattern of [[Book]].
|
|
2766
|
+
* @returns The date the transaction was created, formatted according to the date pattern of the [[Book]].
|
|
2767
2767
|
*/
|
|
2768
2768
|
getCreatedAtFormatted(): string;
|
|
2769
|
+
/**
|
|
2770
|
+
* @returns The date the transaction was last updated.
|
|
2771
|
+
*/
|
|
2772
|
+
getUpdatedAt(): Date;
|
|
2773
|
+
/**
|
|
2774
|
+
* @returns The date the transaction was last updated, formatted according to the date pattern of the [[Book]].
|
|
2775
|
+
*/
|
|
2776
|
+
getUpdatedAtFormatted(): string;
|
|
2769
2777
|
|
|
2770
2778
|
|
|
2771
2779
|
/**
|
package/lib/model/Transaction.js
CHANGED
|
@@ -617,10 +617,22 @@ export class Transaction {
|
|
|
617
617
|
return new Date(new Number(this.payload.createdAt).valueOf());
|
|
618
618
|
}
|
|
619
619
|
/**
|
|
620
|
-
* @returns The date the transaction was created, formatted according to the date pattern of [[Book]].
|
|
620
|
+
* @returns The date the transaction was created, formatted according to the date pattern of the [[Book]].
|
|
621
621
|
*/
|
|
622
622
|
getCreatedAtFormatted() {
|
|
623
|
-
return Utils.formatDate(this.getCreatedAt(), this.book.
|
|
623
|
+
return Utils.formatDate(this.getCreatedAt(), this.book.getDatePattern() + " HH:mm:ss", this.book.getTimeZone());
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* @returns The date the transaction was last updated.
|
|
627
|
+
*/
|
|
628
|
+
getUpdatedAt() {
|
|
629
|
+
return new Date(new Number(this.payload.updatedAt).valueOf());
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* @returns The date the transaction was last updated, formatted according to the date pattern of the [[Book]].
|
|
633
|
+
*/
|
|
634
|
+
getUpdatedAtFormatted() {
|
|
635
|
+
return Utils.formatDate(this.getUpdatedAt(), this.book.getDatePattern() + " HH:mm:ss", this.book.getTimeZone());
|
|
624
636
|
}
|
|
625
637
|
//EVOLVED BALANCES
|
|
626
638
|
/** @internal */
|
package/lib/utils.js
CHANGED
|
@@ -106,8 +106,7 @@ export function formatDate(date, pattern, timeZone) {
|
|
|
106
106
|
if (!pattern) {
|
|
107
107
|
return formatDateISO(date, timeZone);
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
return formatedDate;
|
|
109
|
+
return DateTime.fromJSDate(date, { zone: timeZone }).toFormat(pattern);
|
|
111
110
|
}
|
|
112
111
|
export function formatDateISO(date, timeZone) {
|
|
113
112
|
if (date == null || !(Object.prototype.toString.call(date) === '[object Date]')) {
|
|
@@ -116,8 +115,7 @@ export function formatDateISO(date, timeZone) {
|
|
|
116
115
|
if (!timeZone || timeZone == "") {
|
|
117
116
|
timeZone = "UTC";
|
|
118
117
|
}
|
|
119
|
-
|
|
120
|
-
return formatedDate;
|
|
118
|
+
return DateTime.fromJSDate(date, { zone: timeZone }).toISODate();
|
|
121
119
|
}
|
|
122
120
|
export function getIsoDateValue(date) {
|
|
123
121
|
return +(date.replace(/-/g, ''));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bkper-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.1",
|
|
4
4
|
"description": "Javascript client for Bkper REST API",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"postversion": "git push --tags && yarn publish --new-version $npm_package_version && git push && echo \"Successfully released version $npm_package_version!\""
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@bkper/bkper-api-types": "^5.
|
|
37
|
+
"@bkper/bkper-api-types": "^5.22.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@google-cloud/local-auth": "^3.0.1",
|