timepicker step solve when minutes are 59

This commit is contained in:
Eudes Inácio
2024-02-29 10:23:17 +01:00
parent 16906e68a6
commit 7d08d0d077
2 changed files with 22 additions and 8 deletions
@@ -638,14 +638,14 @@ export class EditEventPage implements OnInit {
}
ajustMinuts(string) {
var data = new Date(string);
if (data.getMinutes() === 59) {
data.setMinutes(0);
var novaString = data.toISOString().slice(0, 16).replace("T", " ");
var partes = string.split(' ');
var horaMinuto = partes[1].split(':');
if (horaMinuto[1] === '59') {
horaMinuto[1] = '00';
var novaString = partes[0] + ' ' + horaMinuto.join(':');
return novaString;
} else {
}
return string;
}
}
}
@@ -107,6 +107,8 @@ export class EditEventPage implements OnInit {
ngOnInit() {
this._postEvent = this.postEvent
this.postEvent.StartDate = new Date(this.ajustMinuts(this.postEvent.StartDate))
this.postEvent.EndDate = new Date(this.ajustMinuts(this.postEvent.EndDate))
if(!this.restoreTemporaryData()) {
// clear
@@ -582,4 +584,16 @@ export class EditEventPage implements OnInit {
}
ajustMinuts(string) {
var partes = string.split(' ');
var horaMinuto = partes[1].split(':');
if (horaMinuto[1] === '59') {
horaMinuto[1] = '00';
var novaString = partes[0] + ' ' + horaMinuto.join(':');
return novaString;
}
return string;
}
}