Rename `DateTimeParts::Millisecond` to `…::SubSecond`

We're currently just tracking whether the second has a fraction so this is
more fitting.
This commit is contained in:
Martchus 2022-08-13 14:07:37 +02:00
parent f20d596785
commit 5fe03c23a2
2 changed files with 3 additions and 3 deletions

View File

@ -150,7 +150,7 @@ enum class DateTimeParts : std::uint64_t {
Hour = (1 << 3), /**< the hour is present */
Minute = (1 << 4), /**< the minute is present */
Second = (1 << 5), /**< the second is present */
Millisecond = (1 << 6), /**< the millisecond is present */
SubSecond = (1 << 6), /**< the second contains a fractional part */
DeltaHour = (1 << 7), /**< the timezone-delta hour is present */
DeltaMinute = (1 << 8), /**< the timezone-delta minute is present */
};

View File

@ -259,7 +259,7 @@ void ChronoTests::testDateTimeExpression()
expr = DateTimeExpression::fromIsoString("1-1-1T0:0:0.0");
CPPUNIT_ASSERT_EQUAL(DateTime(), expr.value);
CPPUNIT_ASSERT_EQUAL(TimeSpan(), expr.delta);
CPPUNIT_ASSERT_EQUAL(parts |= DateTimeParts::Millisecond, expr.parts);
CPPUNIT_ASSERT_EQUAL(parts |= DateTimeParts::SubSecond, expr.parts);
expr = DateTimeExpression::fromIsoString("1-1-1T0:0:0.0+0");
CPPUNIT_ASSERT_EQUAL(DateTime(), expr.value);
CPPUNIT_ASSERT_EQUAL(TimeSpan(), expr.delta);
@ -300,7 +300,7 @@ void ChronoTests::testDateTimeExpression()
expr = DateTimeExpression::fromString("1/1/1 0:0:0.0");
CPPUNIT_ASSERT_EQUAL(DateTime(), expr.value);
CPPUNIT_ASSERT_EQUAL(TimeSpan(), expr.delta);
CPPUNIT_ASSERT_EQUAL(parts |= DateTimeParts::Millisecond, expr.parts);
CPPUNIT_ASSERT_EQUAL(parts |= DateTimeParts::SubSecond, expr.parts);
}
/*!