@bytebrand/export-cars 1.21.63 → 1.21.65

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": "@bytebrand/export-cars",
3
- "version": "1.21.63",
3
+ "version": "1.21.65",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -380,7 +380,7 @@ export class GoogleTransformer {
380
380
  private getMileage(car: DataSchemes.Car): number {
381
381
  let mileage = get(car, 'mainData.mileage', 0);
382
382
 
383
- if ((!car.mainData.firstRegistration || this.monthDiffLess(car, 8)) && mileage < 1000)
383
+ if (mileage < 1000)
384
384
  mileage = 1001
385
385
 
386
386
  return !mileage ? 10 : mileage;
@@ -402,6 +402,12 @@ export class GoogleTransformer {
402
402
  timestamp = Math.round(new Date().getTime() / 1000);
403
403
  }
404
404
 
405
+ if (!car.mainData.firstRegistration || this.monthDiffLess(car, 8)) {
406
+ const currentDate = new Date();
407
+ currentDate.setMonth(currentDate.getMonth() - 9); // Відняти 9 місяців
408
+ timestamp = Math.round(currentDate.getTime() / 1000); // Перетворити на секунди
409
+ }
410
+
405
411
  const date = new Date(timestamp * 1000);
406
412
  const month = date.getUTCMonth() + 1;
407
413
  const year = date.getUTCFullYear();