Commit 171fd620 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

parse 12:xx am correctly.

2001-06-20  Jody Goldberg <jgoldberg@home.com>

	* src/number-match.c (compute_value) : parse 12:xx am correctly.
parent 2d2eb8c1
2001-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (compute_value) : parse 12:xx am correctly.
2001-06-19 Jody Goldberg <jgoldberg@home.com>
* src/commands.c (cmd_search_replace_do_cell) : Adjust to ref
......
2001-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (compute_value) : parse 12:xx am correctly.
2001-06-19 Jody Goldberg <jgoldberg@home.com>
* src/commands.c (cmd_search_replace_do_cell) : Adjust to ref
......
2001-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (compute_value) : parse 12:xx am correctly.
2001-06-19 Jody Goldberg <jgoldberg@home.com>
* src/commands.c (cmd_search_replace_do_cell) : Adjust to ref
......
2001-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (compute_value) : parse 12:xx am correctly.
2001-06-19 Jody Goldberg <jgoldberg@home.com>
* src/commands.c (cmd_search_replace_do_cell) : Adjust to ref
......
2001-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (compute_value) : parse 12:xx am correctly.
2001-06-19 Jody Goldberg <jgoldberg@home.com>
* src/commands.c (cmd_search_replace_do_cell) : Adjust to ref
......
......@@ -711,6 +711,7 @@ compute_value (const char *s, const regmatch_t *mp,
gboolean percentify = FALSE;
gboolean is_number = FALSE;
gboolean is_pm = FALSE;
gboolean is_explicit_am = FALSE;
int idx = 1, i;
int month, day, year, year_short;
int hours, minutes;
......@@ -843,6 +844,8 @@ compute_value (const char *s, const regmatch_t *mp,
case MATCH_AMPM:
if (tolower ((unsigned char) *str) == 'p')
is_pm = TRUE;
else
is_explicit_am = TRUE;
idx++;
break;
......@@ -952,8 +955,11 @@ compute_value (const char *s, const regmatch_t *mp,
if (hours == -1)
hours = 0;
if (is_pm && hours < 12)
hours += 12;
if (is_pm) {
if (hours < 12)
hours += 12;
} else if (is_explicit_am && hours == 12)
hours = 0;
if (hours < 0 || hours > 23)
return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment