Skip to content

Commit

Permalink
Merge pull request #127 from jemu75/dev-v4
Browse files Browse the repository at this point in the history
v4.4.1
  • Loading branch information
jemu75 authored Nov 17, 2024
2 parents 577249a + d0ba9fb commit b7f90cd
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Ersetzungen bieten die Möglichkeit, Werte innerhalb von Element-Definitionen zu
|`state-ts::%d(time)`|2023-12-17 17:53:32|17:53:32|abhängig vom Sprachschema|
|`state-ts::%d(date)`|2023-12-17 17:53:32|17.12.2023|abhängig vom Sprachschema|
|`state-ts::%d({ "weekday"\: "long" })`|2023-12-17 17:53:32|Sonntag|abhängig vom Sprachschema|
|`state-ts::%d({ "diff"\: { "days"\: true, "hours"\: true, "minutes"\: true, "seconds"\: true, "daysSuffix"\: " Tag(e) ", "hoursSuffix"\: "\:", "minutesSuffix"\: "\:", "secondsSuffix"\: " " } } })`||10 Tag(e) 8:07:34|auf korrekte JSON Notation achten und zusätzlich Doppelpunkte escapen|
|`state-ts::%d({ "diff"\: { "days"\: true, "hours"\: true, "minutes"\: true, "seconds"\: true, "daysSuffix"\: " Tag(e) ", "hoursSuffix"\: "\:", "minutesSuffix"\: "\:", "secondsSuffix"\: " " } })`||10 Tag(e) 8:07:34|auf korrekte JSON Notation achten und zusätzlich Doppelpunkte escapen|
|`state::%t(%s)`|on|an|wenn unter [Sprachen](#sprachen) für die Variable `on` im deutschen Sprachschema `an` hinterlegt wurde|
|`state::%r(%s,_, )`|alle_offen|alle offen|ersetzt alle Unterstriche durch Leerzeichen|
|`temp::Temperatur\: %n(1)°C`|18.7|Temperatur: 18,7°C|
Expand Down
5 changes: 4 additions & 1 deletion public/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# v4.4.0 (08.09.2024)
# v4.4.1 (17.11.2024)
## Core
- bugfix for replacer %d
# v4.4.0 (16.11.2024)
## Core
- add replacer %r for replacing values
- new parameter diff for replacer %d to show timedifferences
Expand Down
4 changes: 2 additions & 2 deletions src/stores/fhem.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ export const useFhemStore = defineStore('fhem', () => {
options.secondsSuffix.replace(parts[0], i18n.t(parts[0].slice(3, -1)))
}

if(options.days) res.push(diffDays, options.daysSuffix || ' Tag(e) ')
if(options.days && diffDays > 0) res.push(diffDays, options.daysSuffix || ' Tag(e) ')
if(options.hours) res.push(diffHours, options.hoursSuffix || ' Stunde(n) ')
if(options.minutes) res.push(options.hoursSuffix === ':' && diffMinutes < 10 ? 0 : '', diffMinutes, options.minutesSuffix || ' Minute(n) ')
if(options.seconds) res.push(options.minutesSuffix === ':' && diffSeconds < 10 ? 0 : '', diffSeconds, options.secondsSuffix || ' Sekunde(n) ')
Expand Down Expand Up @@ -875,7 +875,7 @@ export const useFhemStore = defineStore('fhem', () => {
if(!/(T|Z)/.test(date)) date += 'T00:00:00'

if(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/.test(date)) {
res = options.diff ? getTimeDiff(date, options.diff) : def.input.replace(def[0], i18n.d(date, options)).replace(', ',' ')
res = def.input.replace(def[0], options.diff ? getTimeDiff(date, options.diff) : i18n.d(date, options).replace(', ',' '))
} else {
res = def.input.replace(def[0], date + ' -> no ISO-Date')
}
Expand Down
5 changes: 4 additions & 1 deletion www/fhemapp4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# v4.4.0 (08.09.2024)
# v4.4.1 (17.11.2024)
## Core
- bugfix for replacer %d
# v4.4.0 (16.11.2024)
## Core
- add replacer %r for replacing values
- new parameter diff for replacer %d to show timedifferences
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b7f90cd

Please sign in to comment.