Skip to content

Commit 12e9d73

Browse files
committed
Fix a problem with duplicate tags
1 parent 2717ce3 commit 12e9d73

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/check-for-updates.main.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ val reader = tryTo("initialize the feed reader") { XmlReader(feedUrl) }
2424
val file = File("last-rss-update.txt")
2525
val feed = SyndFeedInput().build(reader)
2626
val ours = file.readText().trimEnd().parse()
27+
val ourDate = ours.toLocalDate().toString()
2728
val theirs = feed.publishedDate.toString().parse()
2829
val theirDate = theirs.toLocalDate().toString()
29-
val theirTime = theirs.toLocalTime().format(ISO_LOCAL_TIME)
30+
val theirTime = theirs.toLocalTime().format(DateTimeFormatter.ofPattern("hha"))
3031
val areTheSame = ours == theirs
3132
val freshness = if (areTheSame) "latest" else "stale"
32-
val dateTag = theirDate + if (areTheSame) "T$theirTime" else ""
33+
val dateTag = theirDate + if (ourDate == theirDate) "@$theirTime" else ""
3334
reader.close()
3435

3536
// To log for debug

0 commit comments

Comments
 (0)