Skip to content

Commit be42388

Browse files
committed
fix
1 parent a5eafd8 commit be42388

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/pages/add-alert/add-alert.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export class AddAlertPage {
3636
hour: string;
3737
timeOfDay: string;
3838
minutes: string;
39+
currentMinutes: string;
3940
constructor(public navParams: NavParams, private view: ViewController, private global: Globalization) {
4041

4142
// get date based on timezone
@@ -45,6 +46,8 @@ export class AddAlertPage {
4546
let hours = time[0].split("T");
4647
let minutes = time[1];
4748
this.currentHour = hours[1];
49+
this.currentMinutes = minutes;
50+
4851
console.log(this.date);
4952
this.dayInt = new Date().getDay();
5053
console.log(this.dayInt);
@@ -138,7 +141,11 @@ export class AddAlertPage {
138141
// if not repeating
139142
else {
140143
// check whether alert should be on current day or next day
141-
if (parseInt(this.hour) > parseInt(this.currentHour)) {
144+
145+
if (this.hour == '12' && this.timeOfDay == 'pm') {
146+
this.hour = '24';
147+
}
148+
if ((parseInt(this.hour) > parseInt(this.currentHour)) || ((parseInt(this.hour) == parseInt(this.currentHour)) && (parseInt(this.minutes) > parseInt(this.currentMinutes)))) {
142149
day = [this.day];
143150
}
144151
else {

0 commit comments

Comments
 (0)