Allow for making an appointment punctual
This allows for setting an empty end time when editing an item, converting it into a punctual appointment. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
2b5f891ba3
commit
19290ca39a
11
src/ui-day.c
11
src/ui-day.c
@ -78,11 +78,16 @@ static int day_edit_duration(int start, int dur, unsigned *new_duration)
|
|||||||
unsigned hr, mn;
|
unsigned hr, mn;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
int ret;
|
||||||
|
|
||||||
status_mesg(msg_time, "");
|
status_mesg(msg_time, "");
|
||||||
if (updatestring(win[STA].p, ×tr, 0, 1) !=
|
ret = updatestring(win[STA].p, ×tr, 0, 1);
|
||||||
GETSTRING_VALID)
|
if (ret == GETSTRING_ESC) {
|
||||||
return 0;
|
return 0;
|
||||||
if (*timestr == '+'
|
} else if (ret == GETSTRING_RET) {
|
||||||
|
*new_duration = 0;
|
||||||
|
break;
|
||||||
|
} else if (*timestr == '+'
|
||||||
&& parse_duration(timestr + 1, new_duration) == 1) {
|
&& parse_duration(timestr + 1, new_duration) == 1) {
|
||||||
*new_duration *= MININSEC;
|
*new_duration *= MININSEC;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user