Skip to content

Commit

Permalink
feat: find artifactory timestamp by column
Browse files Browse the repository at this point in the history
  • Loading branch information
Arc676 committed Dec 24, 2024
1 parent 1677d53 commit b81015b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ <h1>Index</h1>
<pre>
<a href="..">..</a>
<a href="1.0.0">1.0.0</a> 21-Jul-2021 20:08 -
<a href="1.0.1">1.0.1</a> 23-Aug-2021 20:03 -
<a href="1.0.2">1.0.2</a> 21-Jul-2021 20:09 -
<a href="1.0.3">1.0.3</a> 06-Feb-2021 09:54 -
<a href="1.0.1">1.0.1</a> 23-Aug-2021 20:03 12 MB
<a href="1.0.2">1.0.2</a> 21-Jul-2021 20:09 123.45 GB
<a href="1.0.3">1.0.3</a> 06-Feb-2021 09:54 9.0 KB
</pre>
<hr/>
<address style="font-size:small;">Artifactory Port 8080</address>
Expand Down
8 changes: 7 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 @@ -114,6 +115,11 @@ export class ArtifactoryDatasource extends Datasource {
}

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

0 comments on commit b81015b

Please sign in to comment.