Omit default components when formatting date time

It just looks nicer to have e.g. "2017" instead of "2017-01-01T00:00:00".
The ID3v2.4.0 standard and the Matroska standard explicitely allow this
format as well.
This commit is contained in:
Martchus 2020-04-26 21:45:20 +02:00
parent 13a87b473d
commit 44fea6c8c2
1 changed files with 1 additions and 1 deletions

View File

@ -667,7 +667,7 @@ void TagValue::toString(string &result, TagTextEncoding encoding) const
result = toTimeSpan().toString();
break;
case TagDataType::DateTime:
result = toDateTime().toIsoString();
result = toDateTime().toString(DateTimeOutputFormat::IsoOmittingDefaultComponents);
break;
default:
throw ConversionException(argsToString("Can not convert ", tagDataTypeString(m_type), " to string."));