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:
Lukas Fleischer 2013-07-18 12:10:25 +02:00
parent 2b5f891ba3
commit 19290ca39a

View File

@ -78,11 +78,16 @@ static int day_edit_duration(int start, int dur, unsigned *new_duration)
unsigned hr, mn;
for (;;) {
int ret;
status_mesg(msg_time, "");
if (updatestring(win[STA].p, &timestr, 0, 1) !=
GETSTRING_VALID)
ret = updatestring(win[STA].p, &timestr, 0, 1);
if (ret == GETSTRING_ESC) {
return 0;
if (*timestr == '+'
} else if (ret == GETSTRING_RET) {
*new_duration = 0;
break;
} else if (*timestr == '+'
&& parse_duration(timestr + 1, new_duration) == 1) {
*new_duration *= MININSEC;
break;