Bugfix/fix date format parsing in activities import (#2051)
* Fix date format parsing * Update changelog
This commit is contained in:
parent
7082ff12f8
commit
64087de3fc
@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Added a semantic list structure to the header navigation
|
- Added a semantic list structure to the header navigation
|
||||||
- Added a default value for the `includeHistoricalData` attribute in the symbol data endpoint
|
- Added a default value for the `includeHistoricalData` attribute in the symbol data endpoint
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed an issue with the date format parsing in the activities import
|
||||||
|
|
||||||
## 1.276.0 - 2023-06-03
|
## 1.276.0 - 2023-06-03
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -223,16 +223,16 @@ export class ImportActivitiesService {
|
|||||||
|
|
||||||
for (const key of ImportActivitiesService.DATE_KEYS) {
|
for (const key of ImportActivitiesService.DATE_KEYS) {
|
||||||
if (item[key]) {
|
if (item[key]) {
|
||||||
if (isMatch(item[key], 'dd-MM-yyyy') && item[key].length === '10') {
|
if (isMatch(item[key], 'dd-MM-yyyy') && item[key].length === 10) {
|
||||||
// Check length to only match yyyy (and not yy)
|
// Check length to only match yyyy (and not yy)
|
||||||
date = parse(item[key], 'dd-MM-yyyy', new Date()).toISOString();
|
date = parse(item[key], 'dd-MM-yyyy', new Date()).toISOString();
|
||||||
} else if (
|
} else if (
|
||||||
isMatch(item[key], 'dd/MM/yyyy') &&
|
isMatch(item[key], 'dd/MM/yyyy') &&
|
||||||
item[key].length === '10'
|
item[key].length === 10
|
||||||
) {
|
) {
|
||||||
// Check length to only match yyyy (and not yy)
|
// Check length to only match yyyy (and not yy)
|
||||||
date = parse(item[key], 'dd/MM/yyyy', new Date()).toISOString();
|
date = parse(item[key], 'dd/MM/yyyy', new Date()).toISOString();
|
||||||
} else if (isMatch(item[key], 'yyyyMMdd') && item[key].length === '8') {
|
} else if (isMatch(item[key], 'yyyyMMdd') && item[key].length === 8) {
|
||||||
// Check length to only match yyyy (and not yy)
|
// Check length to only match yyyy (and not yy)
|
||||||
date = parse(item[key], 'yyyyMMdd', new Date()).toISOString();
|
date = parse(item[key], 'yyyyMMdd', new Date()).toISOString();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user