diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2024-03-11 23:10:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-11 23:10:09 +0100 |
commit | 2f3f1fd1861f3a76b8473e0734956d7e7a417c0e (patch) | |
tree | af77295f3afdd4367095399c5b1eec742a11c963 /app/src/androidTest/java | |
parent | 5c98a33ed2c82fa6b9b45c7234d429d356f17d8c (diff) | |
download | AntennaPod-2f3f1fd1861f3a76b8473e0734956d7e7a417c0e.zip |
Move import/export to its own module (#6986)
Also clean up ImportExportPreferencesFragment a bit.
Diffstat (limited to 'app/src/androidTest/java')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java index 6b85f3bf8..ec4a58e33 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java +++ b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java @@ -6,13 +6,15 @@ import org.xmlpull.v1.XmlSerializer; import java.io.IOException; import java.io.OutputStream; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; +import java.util.Locale; import de.danoeh.antennapod.model.feed.Feed; import de.danoeh.antennapod.model.feed.FeedFunding; import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.parser.feed.namespace.PodcastIndex; -import de.danoeh.antennapod.core.util.DateFormatter; /** * Creates RSS 2.0 feeds. See FeedGenerator for more information. @@ -98,7 +100,7 @@ public class Rss2Generator implements FeedGenerator { } if (item.getPubDate() != null) { xml.startTag(null, "pubDate"); - xml.text(DateFormatter.formatRfc822Date(item.getPubDate())); + xml.text(formatRfc822Date(item.getPubDate())); xml.endTag(null, "pubDate"); } if ((flags & FEATURE_WRITE_GUID) != 0) { @@ -132,4 +134,9 @@ public class Rss2Generator implements FeedGenerator { xml.endDocument(); } + + private static String formatRfc822Date(Date date) { + SimpleDateFormat format = new SimpleDateFormat("dd MMM yy HH:mm:ss Z", Locale.US); + return format.format(date); + } } |