Skip to content

Commit

Permalink
refactor: use luxon for parsing
Browse files Browse the repository at this point in the history
Format is now fixed
  • Loading branch information
Alessandro Vinciguerra committed Dec 20, 2024
1 parent 6c9be07 commit 2e8ac09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/modules/datasource/artifactory/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DateTime } from 'luxon';
import { logger } from '../../../logger';
import { cache } from '../../../util/cache/package/decorator';
import { parse } from '../../../util/html';
Expand Down Expand Up @@ -115,7 +116,7 @@ export class ArtifactoryDatasource extends Datasource {

private static parseReleaseTimestamp(rawText: string): string {
return (
rawText.split(regEx(/\s{2,}/)).filter(e => !isNaN(Date.parse(e)))[0] + 'Z'
rawText.split(regEx(/\s{2,}/)).filter(e => DateTime.fromFormat(e, "dd-LLL-yyyy HH:mm").isValid)[0] + 'Z'
);
}
}

0 comments on commit 2e8ac09

Please sign in to comment.