diff --git a/frontend/src/app/modules/schema-engine/sentinel-hub-type/sentinel-hub-type.component.ts b/frontend/src/app/modules/schema-engine/sentinel-hub-type/sentinel-hub-type.component.ts index ffbdf887cb..424636e186 100644 --- a/frontend/src/app/modules/schema-engine/sentinel-hub-type/sentinel-hub-type.component.ts +++ b/frontend/src/app/modules/schema-engine/sentinel-hub-type/sentinel-hub-type.component.ts @@ -111,9 +111,10 @@ export class SentinelHubTypeComponent implements OnInit, OnChanges, AfterViewIni if (!/(\d+)-(\d+)-(\d+)/.test(from)) { from = moment(from).format('YYYY-MM-DD'); } - if (!/(\d+)-(\d+)-(\d+)/.test(from)) { - from = moment(from).format('YYYY-MM-DD'); + if (!/(\d+)-(\d+)-(\d+)/.test(to)) { + from = moment(to).format('YYYY-MM-DD'); } + console.log({from, to}); this.datePicker.patchValue({from, to}); this.generateImageLink(this.control.value, true); }, 200);