Is it possible to place the label like the one shown below? See the label position
You can use the material theme it has this kind of style
msedge_HpNPYcoJG4.png (19.13 KiB) Viewed 339 times
Regarding the format of durationField you can override it like this
class MyDurationField extends DurationField {
static get $name() {
return 'MyDurationField';
}
static get type() {
return 'mydurationfield';
}
get inputValue() {
// Do not use the _value property. If called during configuration, this
// will import the configured value from the config object.
// Return your expected format value
return this.value == null ? '' : this.calcValue(false).toString(this.useAbbreviation);
}
}
MyDurationField.initClass();
You can check the code inside the DurationField.js for more customization options
I am currently using stolkholm styling and everything is designed according to that. Is it not possible while using stolkholm theme and using some custom css styling?
Hi @tasmin
I was able to customize the duration field format using the following code
// Method to convert the magnitude to a formatted string
function toFormattedString(magnitude) {
debugger;
const hours = Math.floor(magnitude);
const minutes = Math.round((magnitude - hours) * 60);
return `${hours}:${minutes.toString().padStart(2, '0')} H`;
}
class MyDurationField extends DurationField {
static get $name() {
return 'MyDurationField';
}
static get type() {
return 'mydurationfield';
}
get inputValue() {
// Do not use the _value property. If called during configuration, this
// will import the configured value from the config object.
// Return your expected format value
debugger;
return this.value == null ? '' : toFormattedString(this._magnitude);
// this.calcValue(false).toString(this.useAbbreviation);
}
}
MyDurationField.initClass();
Whenever I change the value of duration field, I get the alert message , Invalid field value even though it does display the duration value in the correct format
The changed duration value is not reflected on scheduler
Please post data Model definition and data JSON you used. Also I don't see which field is used as data source.
Also please open a new thread. Here we discussed label position, so better to create a new thread to follow forum rule: one thread - one question.