Skip to content

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

show time description while there is another time zone set

bsatarnejad9c87baac9fb0
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index 362e57bd487..c7a81b31081 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -1347,6 +1347,7 @@ en:
header_description: 'View changes made to work packages in the current view within a time period.'
show_changes_since: 'Show changes since'
help_description: 'Default time zone of the instance set by the administrator.'
+ time_description: 'In default time zone: %{time} %{days} day(s).'
time: 'Time'
drop_down:
none: '-'
diff --git a/frontend/src/app/shared/components/show-changes/show-changes.component.html b/frontend/src/app/shared/components/show-changes/show-changes.component.html
index 63159d0a424..8de12dec8bb 100644
--- a/frontend/src/app/shared/components/show-changes/show-changes.component.html
+++ b/frontend/src/app/shared/components/show-changes/show-changes.component.html
@@ -40,9 +40,10 @@
{{availableValue.title}}
</option>
</select>
- <span class="op-show-changes-modal--filter-description"
- > {{ dropDownDescription }} </span>
+
</div>
+ <span slot="description"
+ > {{ dropDownDescription }} </span>
</spot-form-field>
@@ -56,7 +57,7 @@
(change)="timeChange($event.target.value)"
type="time"
class="op-show-changes-modal--time-input"/>
-
+
<div
slot="input"
class="op-show-changes-modal--time-help spot-body-small"
@@ -76,6 +77,8 @@
</spot-tooltip>
</div>
+ <span slot="description"
+ [textContent]="text.time_description()"></span>
</spot-form-field>
<div class="spot-action-bar">
diff --git a/frontend/src/app/shared/components/show-changes/show-changes.component.sass b/frontend/src/app/shared/components/show-changes/show-changes.component.sass
index b3dc45d5d14..bfd8d826500 100644
--- a/frontend/src/app/shared/components/show-changes/show-changes.component.sass
+++ b/frontend/src/app/shared/components/show-changes/show-changes.component.sass
@@ -1,4 +1,5 @@
@import '../../../spot/styles/sass/variables'
+@import "src/assets/sass/helpers"
.op-show-changes-modal
@@ -41,7 +42,7 @@
display: block
&--filter
- margin-bottom: $spot-spacing-0_25
+
&-description
font-size: $spot-spacing-0_75
font-style: italic
diff --git a/frontend/src/app/shared/components/show-changes/show-changes.component.ts b/frontend/src/app/shared/components/show-changes/show-changes.component.ts
index 4e08cc48c1f..bf1322a0601 100644
--- a/frontend/src/app/shared/components/show-changes/show-changes.component.ts
+++ b/frontend/src/app/shared/components/show-changes/show-changes.component.ts
@@ -54,29 +54,34 @@ import { ConfigurationService } from 'core-app/core/config/configuration.service
export class OpShowChangesComponent extends UntilDestroyedMixin implements AfterViewInit {
@HostBinding('class.op-show-changes') className = true;
- public text = {
- toggle_title: this.I18n.t('js.show_changes.toggle_title'),
- header_description: this.I18n.t('js.show_changes.header_description'),
- clear: this.I18n.t('js.show_changes.clear'),
- apply: this.I18n.t('js.show_changes.apply'),
- show_changes_since: this.I18n.t('js.show_changes.show_changes_since'),
- time: this.I18n.t('js.show_changes.time'),
- help_description: this.I18n.t('js.show_changes.help_description'),
- timeZone: this.configuration.isTimezoneSet() ? this.configuration.timezone() : 'local',
- };
-
public opened = false;
public dropDownDescription = '';
public nonWorkingDays:IDay[] = [];
+ public selectedDate = '';
+
+ public selectedTimezoneFormattedTime = '';
+
public filterSelected = false;
- public selectedDate = '';
+ public daysNumber = 0;
public tooltipPosition = SpotDropAlignmentOption.BottomRight;
+ public text = {
+ toggle_title: this.I18n.t('js.show_changes.toggle_title'),
+ header_description: this.I18n.t('js.show_changes.header_description'),
+ clear: this.I18n.t('js.show_changes.clear'),
+ apply: this.I18n.t('js.show_changes.apply'),
+ show_changes_since: this.I18n.t('js.show_changes.show_changes_since'),
+ time: this.I18n.t('js.show_changes.time'),
+ help_description: this.I18n.t('js.show_changes.help_description'),
+ timeZone: this.configuration.isTimezoneSet() ? moment().tz(this.configuration.timezone()).zoneAbbr() : 'local',
+ time_description: () => this.I18n.t('js.show_changes.time_description', { time: this.selectedTimezoneFormattedTime, days: this.daysNumber }),
+ };
+
public showChangesAvailableValues = [
{
value: '0',
@@ -145,6 +150,7 @@ export class OpShowChangesComponent extends UntilDestroyedMixin implements After
public yesterdayDate():string {
const today = new Date();
+ this.daysNumber = -1;
today.setDate(today.getDate() - 1);
this.selectedDate = moment(today).format('YYYY-MM-DD');
@@ -153,15 +159,17 @@ export class OpShowChangesComponent extends UntilDestroyedMixin implements After
public lastMonthDate():string {
const today = new Date();
+ const lastMonthDate = new Date(today);
- today.setMonth(today.getMonth() - 1);
- this.selectedDate = moment(today).format('YYYY-MM-DD');
+ lastMonthDate.setMonth(today.getMonth() - 1);
+ this.selectedDate = moment(lastMonthDate).format('YYYY-MM-DD');
+ this.daysNumber = moment(lastMonthDate).diff(moment(today), 'days');
return moment(today).format('ddd, YYYY-MM-DD');
}
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');
@@ -193,6 +201,7 @@ export class OpShowChangesComponent extends UntilDestroyedMixin implements After
if (this.isNonWorkingDay(yesterday) || this.weekdaysService.isNonWorkingDay(yesterday)) {
lastWorkingDay = moment(yesterday).format('ddd, YYYY-MM-DD');
this.selectedDate = moment(yesterday).format('YYYY-MM-DD');
+ this.daysNumber = moment(yesterday).diff(moment(today), 'days');
break;
} else {
yesterday.setDate(yesterday.getDate() - 1);
@@ -203,8 +212,11 @@ export class OpShowChangesComponent extends UntilDestroyedMixin implements After
return lastWorkingDay;
}
- public timeChange(value:any):void {
-
+ public timeChange(value:string):void {
+ if (this.configuration.isTimezoneSet()) {
+ const dateTime= `${this.selectedDate} ${value}`;
+ this.selectedTimezoneFormattedTime = this.timezoneService.formattedTime(dateTime);
+ }
}
public filterChange(value:string):void {