We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab40182 commit 635fcf6Copy full SHA for 635fcf6
src/cleaners/date-published.js
@@ -51,9 +51,12 @@ export default function cleanDatePublished(
51
{ timezone, format } = {}
52
) {
53
// If string is in milliseconds or seconds, convert to int and return
54
- if (MS_DATE_STRING.test(dateString) || SEC_DATE_STRING.test(dateString)) {
+ if (MS_DATE_STRING.test(dateString)) {
55
return new Date(parseInt(dateString, 10)).toISOString();
56
}
57
+ if (SEC_DATE_STRING.test(dateString)) {
58
+ return new Date(parseInt(dateString, 10) * 1000).toISOString();
59
+ }
60
61
let date = createDate(dateString, timezone, format);
62
0 commit comments