aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/timeutil.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-18 03:35:43 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-18 03:35:43 +0800
commit55f88f14fed53f67e4b3cd5337cbe92aee0ec638 (patch)
treed783e0896a0649b70ec67c13073841c7f3fbd64f /calendar/timeutil.c
parentad0347d16bfd10f5f6b0783d7030cac420c4362a (diff)
downloadgsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar.gz
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar.bz2
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar.lz
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar.xz
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.tar.zst
gsoc2013-evolution-55f88f14fed53f67e4b3cd5337cbe92aee0ec638.zip
Large number of updates. Recurrence basically works now in most of its
Large number of updates. Recurrence basically works now in most of its forms (daily, weekly, month-by-position). Miguel. svn path=/trunk/; revision=148
Diffstat (limited to 'calendar/timeutil.c')
-rw-r--r--calendar/timeutil.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/calendar/timeutil.c b/calendar/timeutil.c
index 63b78a4152..3e912a0fa3 100644
--- a/calendar/timeutil.c
+++ b/calendar/timeutil.c
@@ -122,15 +122,13 @@ time_t
time_day_hour (time_t t, int hour)
{
struct tm tm;
- time_t retval;
tm = *localtime (&t);
tm.tm_hour = hour;
tm.tm_min = 0;
tm.tm_sec = 0;
- retval = mktime (&tm);
- return retval;
+ return mktime (&tm);
}
@@ -138,22 +136,19 @@ time_t
time_start_of_day (time_t t)
{
struct tm tm;
- time_t retval;
tm = *localtime (&t);
tm.tm_hour = 0;
tm.tm_min = 0;
tm.tm_sec = 0;
- retval = mktime (&tm);
- return retval;
+ return mktime (&tm);
}
time_t
time_end_of_day (time_t t)
{
struct tm tm;
- time_t retval;
tm = *localtime (&t);
tm.tm_hour = 0;
@@ -161,8 +156,7 @@ time_end_of_day (time_t t)
tm.tm_sec = 0;
tm.tm_mday++;
- retval = mktime (&tm);
- return retval;
+ return mktime (&tm);
}
time_t
@@ -187,7 +181,6 @@ time_t
time_year_end (int year)
{
struct tm tm;
- time_t retval;
tm.tm_hour = 23;
tm.tm_min = 59;
@@ -197,6 +190,17 @@ time_year_end (int year)
tm.tm_mday = 31;
tm.tm_isdst = -1;
- retval = mktime (&tm);
- return retval;
+ return mktime (&tm);
+}
+
+time_t
+time_week_begin (time_t t)
+{
+ struct tm tm;
+ time_t retval;
+
+ tm = *localtime (&t);
+ tm.tm_mday -= tm.tm_wday;
+ return mktime (&tm);
}
+