/* * Author: Chris Lord * * Copyright (c) 2007 OpenedHand Ltd - http://www.openedhand.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef JANA_UTILS_H #define JANA_UTILS_H #include #include #include #include gboolean jana_utils_time_is_leap_year (guint16 year); guint8 jana_utils_time_days_in_month (guint16 year, guint8 month); GDateWeekday jana_utils_time_day_of_week (JanaTime *time); guint jana_utils_time_day_of_year (JanaTime *time); GDateWeekday jana_utils_time_set_start_of_week (JanaTime *start); GDateWeekday jana_utils_time_set_end_of_week (JanaTime *end); guint jana_utils_time_week_of_year (JanaTime *time, gboolean week_starts_monday); GDate * jana_utils_time_to_gdate (JanaTime *time); gchar * jana_utils_strftime (JanaTime *time, const gchar *format); gint jana_utils_time_compare (JanaTime *time1, JanaTime *time2, gboolean date_only); JanaTime * jana_utils_time_copy (JanaTime *source, JanaTime *dest); void jana_utils_time_diff (JanaTime *t1, JanaTime *t2, gint *year, gint *month, gint *day, gint *hours, gint *minutes, glong *seconds); void jana_utils_time_adjust (JanaTime *time, gint year, gint month, gint day, gint hours, gint minutes, gint seconds); JanaTime * jana_utils_time_now (JanaTime *time); gboolean jana_utils_duration_contains (JanaDuration *duration, JanaTime *time); JanaEvent * jana_utils_event_copy (JanaEvent *source, JanaEvent *dest); GList * jana_utils_event_get_instances (JanaEvent *event, JanaTime *range_start, JanaTime *range_end, glong offset); void jana_utils_instance_list_free (GList *instances); gchar * jana_utils_get_local_tzname (); struct tm jana_utils_time_to_tm (JanaTime *time); gchar * jana_utils_recurrence_to_string (JanaRecurrence *recur, JanaTime *start); gboolean jana_utils_recurrence_diff (JanaRecurrence *r1, JanaRecurrence *r2); const gchar * jana_utils_ab_day (guint day); #endif /* JANA_UTILS_H */