diff --git a/reader/atom/atom.go b/reader/atom/atom.go
index 28d4e154..30297e58 100644
--- a/reader/atom/atom.go
+++ b/reader/atom/atom.go
@@ -130,9 +130,13 @@ func getRelationURL(links []atomLink, relation string) string {
}
func getDate(a *atomEntry) time.Time {
- dateText := a.Updated
+ // Note: The published date represents the original creation date for YouTube feeds.
+ // Example:
+ // 2019-01-26T08:02:28+00:00
+ // 2019-01-29T07:27:27+00:00
+ dateText := a.Published
if dateText == "" {
- dateText = a.Published
+ dateText = a.Updated
}
if dateText != "" {
diff --git a/reader/atom/parser_test.go b/reader/atom/parser_test.go
index 7339becc..8742359a 100644
--- a/reader/atom/parser_test.go
+++ b/reader/atom/parser_test.go
@@ -546,7 +546,7 @@ func TestParseEntryWithPublishedAndUpdated(t *testing.T) {
t.Error(err)
}
- if !feed.Entries[0].Date.Equal(time.Date(2003, time.December, 13, 18, 30, 2, 0, time.UTC)) {
+ if !feed.Entries[0].Date.Equal(time.Date(2002, time.November, 12, 18, 30, 2, 0, time.UTC)) {
t.Errorf("Incorrect entry date, got: %v", feed.Entries[0].Date)
}
}