|
//Written for the ToDoList (http://www.codeproject.com/KB/applications/todolist2.aspx)
//Design and latest version - http://www.codeproject.com/KB/applications/TDL_Calendar.aspx
//by demon.code.monkey@googlemail.com
#ifndef _CALENDARUTILS_H_
#define _CALENDARUTILS_H_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//CCalendarUtils: a collection of static utils used by the Calendar DLL
class CCalendarUtils
{
//construction
public:
CCalendarUtils() { ASSERT(FALSE); } //don't instantiate me
~CCalendarUtils() { ASSERT(FALSE); } //don't instantiate me
//static functions
public:
static CString LongToString(long lValue);
static time_t DateToTime(const COleDateTime& _dt);
static time_t TimeToTime(const time_t& _t);
#ifdef _DEBUG
static CString DateToString(const COleDateTime& _dt);
#endif
static void GetDateOnly(COleDateTime& _dt);
static void GetToday(COleDateTime& _dt);
static CString GetWeekday(int _iDayOfWeek, BOOL _bShort);
static void GetWeekdays(CStringList& _listDays, BOOL _bShort, BOOL _bWeekendsHidden);
static int CompareDates(const COleDateTime& _dt1, const COleDateTime& _dt2);
static BOOL IsDateValid(const COleDateTime& _dt);
static int GetDaysInMonth(int _iMonth, int _iYear);
static void AddDay(COleDateTime& _dt, int _nNumDays=1);
static void SubtractDay(COleDateTime& _dt, int _nNumDays=1);
static void AddMonth(COleDateTime& _dt, int _nNumMonths=1);
static void SubtractMonth(COleDateTime& _dt, int _nNumMonths=1);
};
#endif//_CALENDARUTILS_H_
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.