mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Date Processing
- Dates now support 'j' and 'J' julian day format.
This commit is contained in:
parent
c8d9a2a268
commit
236738c708
2 changed files with 15 additions and 0 deletions
14
src/Date.cpp
14
src/Date.cpp
|
@ -537,6 +537,20 @@ bool Date::valid (const int m, const int d, const int y)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Julian
|
||||||
|
bool Date::valid (const int d, const int y)
|
||||||
|
{
|
||||||
|
// Check that the year is valid.
|
||||||
|
if (y < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (d < 0 || d > 365)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool Date::leapYear (int year)
|
bool Date::leapYear (int year)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
static bool valid (const std::string&, const std::string& format = "m/d/Y");
|
static bool valid (const std::string&, const std::string& format = "m/d/Y");
|
||||||
static bool valid (const int, const int, const int, const int, const int, const int);
|
static bool valid (const int, const int, const int, const int, const int, const int);
|
||||||
static bool valid (const int, const int, const int);
|
static bool valid (const int, const int, const int);
|
||||||
|
static bool valid (const int, const int);
|
||||||
|
|
||||||
static time_t easter (int year);
|
static time_t easter (int year);
|
||||||
static bool leapYear (int);
|
static bool leapYear (int);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue