Enet4 / dicom-rs

Rust implementation of the DICOM standard
https://dicom-rs.github.io
Apache License 2.0
403 stars 75 forks source link

[core] Handle leap second from chrono time types correctly #428

Closed Enet4 closed 8 months ago

Enet4 commented 8 months ago

chrono 0.4.31 has stricter constraints in time constructor functions, so the cases where a leap second is not allowed are already covered here.

This in turn revealed that dicom-core is not accepting valid times with a leap second from chrono because they are represented differently: whereas our DICOM date time types represent leap seconds as having 60 seconds, like in the encoding of DICOM VRs DT and TM, chrono represents them instead as sub-second fractions larger than 1 second. This requires the seconds and microseconds from these types to be adapted to fit in DicomTime and DicomDateTime.

Resolves the CI error detected in #427.

Summary