@centreon/js-config 25.6.2 → 25.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -271,32 +271,11 @@ export default (on: Cypress.PluginEvents): void => {
271
271
  getExportedFile({ downloadsFolder }: { downloadsFolder: string }): string {
272
272
  const files = fs
273
273
  .readdirSync(downloadsFolder)
274
- .filter((name) => name.startsWith("ResourceStatusExport_all"))
275
- .map((name) => {
276
- const match = name.match(
277
- /ResourceStatusExport_all_(\d+)-(\d+)-(\d+)--(\d+)-(\d+)-(AM|PM)/
278
- );
279
- if (!match) return null;
280
-
281
- const [, month, day, year, hourStr, minuteStr, period] = match;
282
- let hour = parseInt(hourStr, 10);
283
- const minute = parseInt(minuteStr, 10);
284
-
285
- if (period === "PM" && hour < 12) hour += 12;
286
- if (period === "AM" && hour === 12) hour = 0;
287
-
288
- const date = new Date(
289
- `20${year}-${month}-${day}T${String(hour).padStart(2, "0")}:${String(
290
- minute
291
- ).padStart(2, "0")}:00`
292
- );
293
-
294
- return {
295
- name,
296
- time: date.getTime(),
297
- };
298
- })
299
- .filter((item): item is { name: string; time: number } => item !== null)
274
+ .filter((name) => name.startsWith("ResourceStatusExport_all") && name.endsWith(".csv"))
275
+ .map((name) => ({
276
+ name,
277
+ time: fs.statSync(path.join(downloadsFolder, name)).mtime.getTime()
278
+ }))
300
279
  .sort((a, b) => b.time - a.time);
301
280
 
302
281
  if (files.length === 0) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@centreon/js-config",
3
3
  "description": "Centreon Frontend shared build configuration",
4
- "version": "25.6.2",
4
+ "version": "25.6.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/centreon/centreon-frontend.git"