MOBILE-3320 database: Fix some fields not displayed
parent
331fd9fef9
commit
0607bd7f58
|
@ -36,6 +36,10 @@ export class AddonModDataFieldDateComponent extends AddonModDataFieldPluginCompo
|
||||||
*/
|
*/
|
||||||
protected init(): void {
|
protected init(): void {
|
||||||
if (this.displayMode) {
|
if (this.displayMode) {
|
||||||
|
this.displayDate = this.value?.content
|
||||||
|
? parseInt(this.value.content, 10) * 1000
|
||||||
|
: undefined;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,10 +66,6 @@ export class AddonModDataFieldDateComponent extends AddonModDataFieldPluginCompo
|
||||||
? new Date(parseInt(this.value.content, 10) * 1000)
|
? new Date(parseInt(this.value.content, 10) * 1000)
|
||||||
: new Date();
|
: new Date();
|
||||||
|
|
||||||
this.displayDate = this.value?.content
|
|
||||||
? parseInt(this.value.content, 10) * 1000
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addControl('f_' + this.field.id, CoreTimeUtils.toDatetimeFormat(date.getTime()));
|
this.addControl('f_' + this.field.id, CoreTimeUtils.toDatetimeFormat(date.getTime()));
|
||||||
|
|
|
@ -407,7 +407,11 @@ export class CoreDomUtilsProvider {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = Number(size);
|
if (typeof size == 'string') {
|
||||||
|
// It's important to use parseInt instead of Number because Number('') is 0 instead of NaN.
|
||||||
|
size = parseInt(size, 10);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isNaN(size)) {
|
if (!isNaN(size)) {
|
||||||
return size + 'px';
|
return size + 'px';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue