aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/timeutil.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@nuclecu.unam.mx>1998-08-19 08:31:04 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-08-19 08:31:04 +0800
commit6158ea365fc20a777a444011e92713fa3168bdda (patch)
treef51458f962ea8aee3deb0ed465738f96f094f5a0 /calendar/timeutil.c
parentb7c9e891f64f19f1cda1294e1816898518be3ed9 (diff)
downloadgsoc2013-evolution-6158ea365fc20a777a444011e92713fa3168bdda.tar.gz
gsoc2013-evolution-6158ea365fc20a777a444011e92713fa3168bdda.tar.zst
gsoc2013-evolution-6158ea365fc20a777a444011e92713fa3168bdda.zip
We now have a nice generic monthly calendar item for the canvas. We
also have a convenient "Go To" dialog, just like in the PalmPilot. Next step is a pretty month view - Federico 1998-08-18 Federico Mena Quintero <federico@nuclecu.unam.mx> * gnome-month-item.c (gnome_month_item_day2index): New public function to get the displayed day index of the specified date. * gnome-cal.c (gnome_calendar_goto_today): New public function to jump to the current day. * goto.c (day_event): Jump to the selected day when the user clicks the mouse, and prelight days as appropriate. * timeutil.c (time_from_day): New public function to build a time_t from a year/month/day triplet. * gnome-month-item.c (gnome_month_item_num2child): (gnome_month_item_child2num): New public functions to convert an index into a child and vice-versa, respectively. (gnome_month_item_num2day): New public function to convert a child number into a displayed day number. * goto.c (goto_dialog): Doh, use gnome-dialog properly :-) * gnome-month-item.c (create_items): Use g_strdup()ed day names from the start. 1998-08-17 Federico Mena Quintero <federico@nuclecu.unam.mx> * main.c (gnome_toolbar): Made it use goto.xpm. * Makefile.am (EXTRA_DIST): Added goto.xpm to the list of files. svn path=/trunk/; revision=326
Diffstat (limited to 'calendar/timeutil.c')
-rw-r--r--calendar/timeutil.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/calendar/timeutil.c b/calendar/timeutil.c
index f23277ce37..c27a8dbd45 100644
--- a/calendar/timeutil.c
+++ b/calendar/timeutil.c
@@ -148,6 +148,19 @@ time_day_hour (time_t t, int hour)
time_t
+time_from_day (int year, int month, int day)
+{
+ struct tm tm;
+
+ memset (&tm, 0, sizeof (tm));
+ tm.tm_year = year - 1900;
+ tm.tm_mon = month;
+ tm.tm_mday = day;
+
+ return mktime (&tm);
+}
+
+time_t
time_start_of_day (time_t t)
{
struct tm tm;