fix: parse VXNA entry date (#21325)

This commit is contained in:
Leslie Leung
2026-03-09 16:11:48 +08:00
committed by GitHub
parent 8d8a435a48
commit 626d289580

View File

@@ -3,6 +3,7 @@ import { load } from 'cheerio';
import type { Route } from '@/types';
import { ViewType } from '@/types';
import got from '@/utils/got';
import { parseRelativeDate } from '@/utils/parse-date';
export const route: Route = {
path: '/xna',
@@ -39,12 +40,14 @@ async function handler(ctx) {
.map((dom) => {
const link = $(dom).find('.xna-entry-title > a');
const author = $(dom).find('.xna-source-author > a').text();
const dateText = $(dom).find('.xna-entry-date').text().trim();
return {
title: $(link).text(),
link: $(link).attr('href'),
description: $(link).text(),
author,
pubDate: dateText ? parseRelativeDate(dateText) : undefined,
};
});