Fix incorrect handling of 24h overflows with an offset on RDF.XSD.Time
This commit is contained in:
parent
0f42c462ab
commit
ef55979f31
2 changed files with 12 additions and 1 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -5,6 +5,17 @@ This project adheres to [Semantic Versioning](http://semver.org/) and
|
|||
[Keep a CHANGELOG](http://keepachangelog.com).
|
||||
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
|
||||
- `RDF.XSD.Time` didn't handle 24h overflows with an offset correctly
|
||||
|
||||
|
||||
[Compare v0.7.0...HEAD](https://github.com/marcelotto/rdf-ex/compare/v0.7.0...HEAD)
|
||||
|
||||
|
||||
|
||||
## 0.7.0 - 2019-11-22
|
||||
|
||||
### Added
|
||||
|
|
|
@ -58,7 +58,7 @@ defmodule RDF.Time do
|
|||
if (minute = time.minute - minute) < 0 do
|
||||
{rem(24 + time.hour - hour - 1, 24), minute + 60}
|
||||
else
|
||||
{time.hour - hour - div(minute, 60), rem(minute, 60)}
|
||||
{rem(24 + time.hour - hour - div(minute, 60), 24), rem(minute, 60)}
|
||||
end
|
||||
end
|
||||
%Time{time | hour: hour, minute: minute}
|
||||
|
|
Loading…
Reference in a new issue