@bytebrand/export-cars 1.22.23 → 1.22.24

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.22.23",
3
+ "version": "1.22.24",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -8,7 +8,6 @@ import { Injectable } from '@nestjs/common';
8
8
  import { ConfigService, ImagesService, TransformerService, UserService } from '../services';
9
9
  import { GoogleXmlItem } from '../interfaces';
10
10
  import { isValidVin } from '../utils';
11
- import moment from 'moment';
12
11
 
13
12
  const GOOGLE_MAX_TRIM_LENGTH = 50;
14
13
  const TIMESTAMP_FIRST_YEAR = 1970;
@@ -547,9 +546,9 @@ export class GoogleTransformer {
547
546
  // so fall through to other date sources — `year` is a mandatory Google feed field.
548
547
  const firstModelsProductionYear = toSafeInteger(get(car, 'mainData.firstModelsProductionDate', 0));
549
548
  const constructionYear = toSafeInteger(get(car, 'mainData.constructionYear', 0));
550
- const firstRegistrationYear = toSafeInteger(moment(+get(car, 'mainData.firstRegistration', 0) * 1000).format('YYYY'));
551
- const metaCreationYear = toSafeInteger(moment(+get(car, 'metaData.creationDate', 0) * 1000).format('YYYY'));
552
- const currentYear = toSafeInteger(moment().format('YYYY'));
549
+ const firstRegistrationYear = new Date(+get(car, 'mainData.firstRegistration', 0) * 1000).getUTCFullYear();
550
+ const metaCreationYear = new Date(+get(car, 'metaData.creationDate', 0) * 1000).getUTCFullYear();
551
+ const currentYear = new Date().getUTCFullYear();
553
552
 
554
553
  return [firstModelsProductionYear, constructionYear, firstRegistrationYear, metaCreationYear, currentYear]
555
554
  .find(year => year > TIMESTAMP_FIRST_YEAR);