mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
fix date-duration fails with only one date-format eg. "m"
This commit is contained in:
parent
d257077017
commit
638da52fa9
@ -683,7 +683,7 @@ var et2_date_duration = /** @class */ (function (_super) {
|
|||||||
this.duration.text(display.value + " ");
|
this.duration.text(display.value + " ");
|
||||||
}
|
}
|
||||||
// Set unit as figured for display
|
// Set unit as figured for display
|
||||||
if (display.unit != this.options.display_format) {
|
if (display.unit && display.unit != this.options.display_format) {
|
||||||
if (this.format && this.format.children().length > 1) {
|
if (this.format && this.format.children().length > 1) {
|
||||||
jQuery("option[value='" + display.unit + "']", this.format).attr('selected', 'selected');
|
jQuery("option[value='" + display.unit + "']", this.format).attr('selected', 'selected');
|
||||||
}
|
}
|
||||||
@ -693,7 +693,7 @@ var et2_date_duration = /** @class */ (function (_super) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
et2_date_duration.prototype.set_display_format = function (format) {
|
et2_date_duration.prototype.set_display_format = function (format) {
|
||||||
if (format.length <= 1) {
|
if (format.length < 1) {
|
||||||
this.node.remove('select.et2_date_duration');
|
this.node.remove('select.et2_date_duration');
|
||||||
this.format.remove();
|
this.format.remove();
|
||||||
this.format = null;
|
this.format = null;
|
||||||
|
@ -844,7 +844,7 @@ export class et2_date_duration extends et2_date
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set unit as figured for display
|
// Set unit as figured for display
|
||||||
if(display.unit != this.options.display_format)
|
if(display.unit && display.unit != this.options.display_format)
|
||||||
{
|
{
|
||||||
if(this.format && this.format.children().length > 1) {
|
if(this.format && this.format.children().length > 1) {
|
||||||
jQuery("option[value='"+display.unit+"']",this.format).attr('selected','selected');
|
jQuery("option[value='"+display.unit+"']",this.format).attr('selected','selected');
|
||||||
@ -858,7 +858,7 @@ export class et2_date_duration extends et2_date
|
|||||||
|
|
||||||
set_display_format(format)
|
set_display_format(format)
|
||||||
{
|
{
|
||||||
if (format.length <= 1)
|
if (format.length < 1)
|
||||||
{
|
{
|
||||||
this.node.remove('select.et2_date_duration');
|
this.node.remove('select.et2_date_duration');
|
||||||
this.format.remove();
|
this.format.remove();
|
||||||
|
@ -524,6 +524,9 @@ span.et2_date span {
|
|||||||
span.et2_date_duration input.et2_date_duration{
|
span.et2_date_duration input.et2_date_duration{
|
||||||
width: 25%;
|
width: 25%;
|
||||||
}
|
}
|
||||||
|
span.et2_date_duration span {
|
||||||
|
vertical-align: -webkit-baseline-middle;
|
||||||
|
}
|
||||||
.et2_date.required, .et2_date[required] {
|
.et2_date.required, .et2_date[required] {
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user