OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Use formattedDate instead of ISO8601
bsatarnejad640e326334a7
diff --git a/config/locales/js-en.yml b/config/locales/js-en.ymlindex b9d764e56c2..4d467539207 100644--- a/config/locales/js-en.yml+++ b/config/locales/js-en.yml@@ -1341,7 +1341,7 @@ en:does_not_match_search: 'Project does not match the search criteria.'no_results: 'No project matches your search criteria.'baseline:- toggle_title: 'Changes'+ toggle_title: 'Baseline'clear: 'Clear'apply: 'Apply'header_description: 'View changes made to work packages in the current view within a time period.'diff --git a/frontend/src/app/shared/components/baseline/baseline.component.ts b/frontend/src/app/shared/components/baseline/baseline.component.tsindex 2183f1d9d08..bc49ea3da8a 100644--- a/frontend/src/app/shared/components/baseline/baseline.component.ts+++ b/frontend/src/app/shared/components/baseline/baseline.component.ts@@ -153,8 +153,8 @@ export class OpBaselineComponent extends UntilDestroyedMixin implements AfterViethis.daysNumber = -1;today.setDate(today.getDate() - 1);- this.selectedDate = moment(today).format('YYYY-MM-DD');- return moment(today).format('ddd, YYYY-MM-DD');+ this.selectedDate = this.timezoneService.formattedDate(today.toString());+ return this.selectedDate;}public lastMonthDate():string {@@ -162,17 +162,17 @@ export class OpBaselineComponent extends UntilDestroyedMixin implements AfterVieconst lastMonthDate = new Date(today);lastMonthDate.setMonth(today.getMonth() - 1);- this.selectedDate = moment(lastMonthDate).format('YYYY-MM-DD');+ this.selectedDate = this.timezoneService.formattedDate(lastMonthDate.toString());this.daysNumber = moment(lastMonthDate).diff(moment(today), 'days');- return moment(today).format('ddd, YYYY-MM-DD');+ return this.selectedDate;}public lastweekDate():string {const today = new Date();this.daysNumber = -7;today.setDate(today.getDate() - 7);- this.selectedDate = moment(today).format('YYYY-MM-DD');- return moment(today).format('ddd, YYYY-MM-DD');+ this.selectedDate = this.timezoneService.formattedDate(today.toString());+ return this.selectedDate;}async requireNonWorkingDaysOfTwoYears() {@@ -194,22 +194,20 @@ export class OpBaselineComponent extends UntilDestroyedMixin implements AfterViepublic lastWorkingDate():string {const today = new Date();const yesterday = new Date(today);- let lastWorkingDay = '';-+ this.selectedDate = '';yesterday.setDate(today.getDate() - 1);- while (lastWorkingDay === '') {+ while (this.selectedDate === '') {if (this.isNonWorkingDay(yesterday) || this.weekdaysService.isNonWorkingDay(yesterday)) {yesterday.setDate(yesterday.getDate() - 1);continue;} else {- lastWorkingDay = moment(yesterday).format('ddd, YYYY-MM-DD');- this.selectedDate = moment(yesterday).format('YYYY-MM-DD');+ this.selectedDate = this.timezoneService.formattedDate(yesterday.toString());this.daysNumber = moment(yesterday).diff(moment(today), 'days');break;}}- return lastWorkingDay;+ return this.selectedDate;}public timeChange(value:string):void {@@ -217,7 +215,7 @@ export class OpBaselineComponent extends UntilDestroyedMixin implements AfterVieif (timeZone) {this.timeZoneSelected = true;const dateTime= `${this.selectedDate} ${value}`;- this.selectedTimezoneFormattedTime = this.timezoneService.formattedTime(dateTime);+ this.selectedTimezoneFormattedTime = this.timezoneService.formattedDatetime(dateTime);}}