Skip to content

Latest晚点 时间解析出错 #20878

@andy-lee-cat

Description

@andy-lee-cat

路由地址

/latepost/:proma?

完整路由地址

/latepost/:proma?

相关文档

https://rsshub.netlify.app/zh/routes/new-media#晚点-latepost

预期是什么?

晚点有“昨天 23:01”这种格式,比如 晚点昨天23:01的一篇报道,在1月14日显示的就是“昨天 23:01”

期望解析成26年1月13日 23:01.

实际发生了什么?

实际解析成了25年12月28日。

https://github.com/DIYgod/RSSHub/blob/master/lib/routes/latepost/index.ts

const pubDate = content('div.article-header-date').text();

if (pubDate) {
    item.pubDate = /\d+\d+/.test(pubDate) ? parseDate(pubDate, ['YYYY年MM月DD日 HH:mm', 'MM月DD日 HH:mm']) : parseRelativeDate(pubDate);
}

这里的调用链少了对“昨天 MM:SS”的处理

部署

自建

部署相关信息

No response

额外信息

这不是重复的 issue

  • 我已经搜索了 现有 issue,以确保该错误尚未被报告。

Metadata

Metadata

Assignees

No one assigned

    Labels

    RSS bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions