-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDate.h
45 lines (44 loc) · 1.34 KB
/
Date.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include<cstring>
#include"Time.h"
#pragma warning(disable:4996)
class Date {
unsigned year;
unsigned month;
unsigned day;
Time time;
bool isLeapYear() const;
void ifNineteenSixteen();
unsigned daysInMonth;
public:
void changeDaysInMonth();
Date();
void copyFromOther(const Date& date);
Date(unsigned year, unsigned month, unsigned day, const Time& time);
bool isValidDay(unsigned number)const;
bool validDate()const;
unsigned getYear()const;
unsigned getMonth()const;
unsigned getDay()const;
unsigned getDaysInMonth()const;
Time& getTime()const;
void setDayThirtyOne(unsigned);
void setLater(unsigned);
void setYear(unsigned);
void setMonth(unsigned);
void setDay(unsigned);
void setTime(const Time& time);
bool checkBusyPeriod(const Time& st, const Time& ed)const;
void setIfBusyPeriod(const Time& st, const Time& ed, bool is);
Date& timeLater(const Time& time)const;
Date& daysLater(unsigned number)const;
Date& monthsLater(unsigned number)const;
Date& yearsLater(unsigned number)const;
void operator=(const Date& date);
int compareD(const Date& other)const;
int compareNoTime(const Date& other) const;
const char* dayOfWeek()const;
void printD()const;
void printNoTime()const;
void createInvalidDate(unsigned year, unsigned month, unsigned day, const Time& time);
};