13 #ifndef mitkSemanticTypes_h
14 #define mitkSemanticTypes_h
16 #define BOOST_DATE_TIME_NO_LIB
17 #if defined(BOOST_ALL_DYN_LINK)
18 #undef BOOST_ALL_DYN_LINK
22 #include <boost/date_time/gregorian/gregorian.hpp>
31 namespace SemanticTypes
33 using ID = std::string;
43 boost::gregorian::date
date;
47 date = boost::gregorian::date(boost::gregorian::min_date_time);
58 std::stringstream controlPointAsString;
59 if (
date.is_not_a_date())
64 controlPointAsString << std::to_string(
date.year()) <<
"-"
65 << std::setfill(
'0') << std::setw(2) << std::to_string(
date.month()) <<
"-"
66 << std::setfill(
'0') << std::setw(2) << std::to_string(
date.day());
68 return controlPointAsString.str();
73 date = boost::gregorian::from_undelimited_string(dateAsString);
78 boost::gregorian::date_duration duration =
date - other.
date;
79 return std::abs(duration.days());