Skip to content

Commit

Permalink
fix: fix output for single point entries
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <meteyou@gmail.com>
  • Loading branch information
meteyou committed Apr 27, 2024
1 parent 1d54cfa commit a29fe5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export default class HistoryListPanelDetailMaintenance extends Mixins(BaseMixin)
}
get outputFirstPointOfHistory() {
if (this.item.reminder.type === null) return this.$t('History.EntrySince')
if (this.item.end_time === null) return this.$t('History.EntryNextPerform')
return this.$t('History.EntryPerformedAt', { date: this.formatDateTime(this.item.end_time * 1000) })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export default class HistoryListPanelDetailMaintenanceHistoryEntry extends Mixin
}
get showGoals() {
if (this.item.reminder.type === null) return false
return this.current && this.item.end_time === null
}
Expand Down Expand Up @@ -112,6 +114,8 @@ export default class HistoryListPanelDetailMaintenanceHistoryEntry extends Mixin
const value = this.item.reminder.printtime?.value ?? 0
if (!this.showGoals) return `${this.restPrinttime.toFixed(1)} h`
if (!this.item.reminder.printtime.bool) return false
return `${this.restPrinttime.toFixed(1)} / ${value} h`
}
Expand Down Expand Up @@ -143,6 +147,8 @@ export default class HistoryListPanelDetailMaintenanceHistoryEntry extends Mixin
if (!this.showGoals) return `${this.restDays.toFixed(0)} days`
if (!this.item.reminder.date.bool) return false
return `${this.restDays.toFixed(0)} / ${value} days`
}
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@
"EntryCreatedAt": "Created at {date}.",
"EntryNextPerform": "Next perform:",
"EntryPerformedAt": "Performed at {date}.",
"EntrySince": "Used since:",
"EstimatedFilament": "Estimated Filament",
"EstimatedFilamentWeight": "Estimated Filament Weight",
"EstimatedTime": "Estimated Time",
Expand Down

0 comments on commit a29fe5b

Please sign in to comment.