From 735703cb9a00d448118c6ad55712ecfb2e42266a Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 3 Oct 2023 16:08:30 -0400 Subject: [PATCH] fix(ds): deconstruct date, time, seconds from API response Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts | 7 +++++-- packages/zowe-explorer/src/job/ZoweJobNode.ts | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts index a72a95b934..26d12a7904 100644 --- a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts +++ b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts @@ -237,10 +237,13 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod msg: localize("getChildren.invalidMember", "Cannot access member with control characters in the name: {0}", item.member), }); } - if (item.m4date) { + + // get user and last modified date for sorting, if available + const { m4date, mtime, msec }: { m4date: string; mtime: string; msec: string } = item; + if (m4date) { temp.stats = { user: item.user, - m4date: new Date(`${item.m4date.replace(/\//g, "-")}T${item.mtime as string}:${item.msec as string}`), + m4date: new Date(`${m4date.replace(/\//g, "-")}T${mtime}:${msec}`), }; } elementChildren[temp.label.toString()] = temp; diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 1bcc7f86f3..dc757c8b2d 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -89,8 +89,8 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { this.iconPath = icon.path; } - if (!globals.ISTHEIA && !(this instanceof Spool)) { - this.id = `${mParent?.id ?? mParent?.label?.toString() ?? ""}.${this.label as string}`; + if (!globals.ISTHEIA && contextually.isSession(this)) { + this.id = this.label as string; } }