@bytebrand/export-cars 1.21.47 → 1.21.48
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
|
@@ -339,19 +339,21 @@ export class GoogleTransformer {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
private getDateFirstRegistered(car: DataSchemes.Car): string {
|
|
342
|
-
let timestamp = +get(car, 'mainData.firstRegistration', '')
|
|
342
|
+
let timestamp = +get(car, 'mainData.firstRegistration', '');
|
|
343
343
|
|
|
344
344
|
if (!timestamp) {
|
|
345
|
-
timestamp = Math.round(new Date().getTime() / 1000)
|
|
345
|
+
timestamp = Math.round(new Date().getTime() / 1000);
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
const date = new Date(timestamp * 1000);
|
|
349
|
+
const day = date.getUTCDate();
|
|
349
350
|
const month = date.getUTCMonth() + 1;
|
|
350
351
|
const year = date.getUTCFullYear();
|
|
351
352
|
|
|
353
|
+
const formattedDay = day < 10 ? `0${day}` : day;
|
|
352
354
|
const formattedMonth = month < 10 ? `0${month}` : month;
|
|
353
355
|
|
|
354
|
-
return `${formattedMonth}
|
|
356
|
+
return `${year}-${formattedMonth}-${formattedDay}`;
|
|
355
357
|
}
|
|
356
358
|
|
|
357
359
|
private isNotEmptyArray(array: any[]): boolean {
|