mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 20:49:04 +01:00
fix display_format="hⓂ️s" for r/o only gave one best matching unit (eg. 5m) not all units (eg. 0:05:30)
This commit is contained in:
parent
83cfb34c3c
commit
832725ce52
@ -260,6 +260,16 @@ export class Et2DateDuration extends Et2InputWidget(FormControlMixin(LitElement)
|
|||||||
this.formatter = formatDuration;
|
this.formatter = formatDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transformAttributes(attrs)
|
||||||
|
{
|
||||||
|
// Clean formats
|
||||||
|
if (typeof attrs.display_format === 'string')
|
||||||
|
{
|
||||||
|
attrs.display_format = attrs.display_format.replace(/[^dhms]/g,'');
|
||||||
|
}
|
||||||
|
super.transformAttributes(attrs);
|
||||||
|
}
|
||||||
|
|
||||||
get value() : string
|
get value() : string
|
||||||
{
|
{
|
||||||
let value = 0;
|
let value = 0;
|
||||||
|
@ -32,6 +32,14 @@ export class Et2DateDurationReadonly extends Et2DateDuration
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
|
||||||
|
// Property defaults
|
||||||
|
this.select_unit = false; // otherwise just best matching unit will be used for eg. display_format "h:m:s"
|
||||||
|
}
|
||||||
|
|
||||||
get value()
|
get value()
|
||||||
{
|
{
|
||||||
return this.__value;
|
return this.__value;
|
||||||
|
@ -767,7 +767,7 @@ export class et2_date_duration extends et2_date
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clean formats
|
// Clean formats
|
||||||
this.options.display_format = this.options.display_format.replace(/[^dhms]/,'');
|
this.options.display_format = this.options.display_format.replace(/[^dhms]/g,'');
|
||||||
if(!this.options.display_format)
|
if(!this.options.display_format)
|
||||||
{
|
{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
Loading…
Reference in New Issue
Block a user