|
@@ -3,7 +3,7 @@
|
|
|
* Company: Lynar Studios
|
|
* Company: Lynar Studios
|
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
|
* Created: 2020-08-14
|
|
* Created: 2020-08-14
|
|
|
- * Changed: 2023-05-24
|
|
|
|
|
|
|
+ * Changed: 2025-12-21
|
|
|
*
|
|
*
|
|
|
* */
|
|
* */
|
|
|
|
|
|
|
@@ -28,25 +28,25 @@ Date::Date() : Class("Date")
|
|
|
|
|
|
|
|
Date::~Date() noexcept = default;
|
|
Date::~Date() noexcept = default;
|
|
|
|
|
|
|
|
-Date &Date::operator+(int _value)
|
|
|
|
|
|
|
+Date &Date::operator+(const int _value)
|
|
|
{
|
|
{
|
|
|
this->_incrementByDays(_value);
|
|
this->_incrementByDays(_value);
|
|
|
return *this;
|
|
return *this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-Date &Date::operator-(int _value)
|
|
|
|
|
|
|
+Date &Date::operator-(const int _value)
|
|
|
{
|
|
{
|
|
|
this->_decrementByDays(_value);
|
|
this->_decrementByDays(_value);
|
|
|
return *this;
|
|
return *this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-Date &Date::operator+=(int _value)
|
|
|
|
|
|
|
+Date &Date::operator+=(const int _value)
|
|
|
{
|
|
{
|
|
|
this->_incrementByDays(_value);
|
|
this->_incrementByDays(_value);
|
|
|
return *this;
|
|
return *this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-Date &Date::operator-=(int _value)
|
|
|
|
|
|
|
+Date &Date::operator-=(const int _value)
|
|
|
{
|
|
{
|
|
|
this->_decrementByDays(_value);
|
|
this->_decrementByDays(_value);
|
|
|
return *this;
|
|
return *this;
|
|
@@ -97,7 +97,7 @@ time_t Date::getTime() const
|
|
|
return this->timestamp;
|
|
return this->timestamp;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void Date::setTime(time_t _timestamp)
|
|
|
|
|
|
|
+void Date::setTime(const time_t _timestamp)
|
|
|
{
|
|
{
|
|
|
this->timestamp = _timestamp;
|
|
this->timestamp = _timestamp;
|
|
|
this->_init();
|
|
this->_init();
|
|
@@ -111,12 +111,12 @@ string Date::toString() const
|
|
|
return _stream.str();
|
|
return _stream.str();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void Date::_decrementByDays(int _value)
|
|
|
|
|
|
|
+void Date::_decrementByDays(const int _value)
|
|
|
{
|
|
{
|
|
|
this->timestamp -= (_value * 86400);
|
|
this->timestamp -= (_value * 86400);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void Date::_incrementByDays(int _value)
|
|
|
|
|
|
|
+void Date::_incrementByDays(const int _value)
|
|
|
{
|
|
{
|
|
|
this->timestamp += (_value * 86400);
|
|
this->timestamp += (_value * 86400);
|
|
|
}
|
|
}
|