Skip to content

Commit

Permalink
- Changed OnetArticleMapper to use ZonedDateTime instead of OffsetDat…
Browse files Browse the repository at this point in the history
…eTime
  • Loading branch information
Eukon05 committed Oct 3, 2024
1 parent 32b1dba commit 01a9a6d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.jsoup.nodes.Element;
import ovh.eukon05.infodb.api.source.Article;

import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

final class OnetArticleMapper {
Expand All @@ -26,7 +26,7 @@ static Article mapFromHtml(Element articleElement, OnetArticleDetails details) {
String title = articleElement.getElementsByTag("span").text();

// Article will have its publication time shifted to the UTC timezone this way!
OffsetDateTime pubDate = OffsetDateTime.parse(details.pubDate(), DTF);
ZonedDateTime pubDate = ZonedDateTime.parse(details.pubDate(), DTF);

return new Article(id, PROVIDER, title, url, imageUrl, pubDate.toInstant(), details.tags());
}
Expand Down

0 comments on commit 01a9a6d

Please sign in to comment.