-
Notifications
You must be signed in to change notification settings - Fork 58
Table Viewer optimization in ITC #1466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
176ab4b
c12016f
9d1aff6
328b22d
70069a6
179fcb7
16eedec
2ab7999
e78ff54
5383d38
ed6a9ed
cd0ef99
019bd3d
d39ce5d
bbcc56d
192c22f
7ec2b55
7e4d8a2
b5785aa
207d325
674c87e
a23005e
9cfb1f6
ce94b23
3e92c0d
7bca4b8
bdf1181
ea8e546
6260bdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,76 @@ export const extractTextBetweenTags = ( | |
.replace(/\n$/, "") | ||
: text; | ||
}; | ||
|
||
export const getColumnIconType = ({ | ||
type, | ||
format, | ||
}: { | ||
index: number; | ||
type: string; | ||
name: string; | ||
format: string; | ||
}) => { | ||
format = format.toUpperCase(); | ||
|
||
const isDateFormat = () => | ||
[ | ||
"DAT", | ||
"MM", | ||
"DD", | ||
"YY", | ||
"EURDF", | ||
"JUL", | ||
"YEAR", | ||
"DAY", | ||
"MONTH", | ||
"MON", | ||
"DOWNAME", | ||
].some((f) => format.includes(f)) && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add 8601 formats? They are common in clinical programming. Date: E8601DA, E8601DN, D8601DA, D8601DN: ([B|E]8601D[N|A]) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @scnwwu: Perhaps enhancing SAS format support to include the lateset available SAS-provided formats should be moved into a dedicated pull request? @DmitryMK: Also wanted to create awarenes for the fact the the doc link mentioned in the previous comment for National Language Support formats is really old. Here are doc links that will always point to the latest production: Tip: Use .../default/... instead of .../v_xxx/... in SAS Viya 4 doc links, so they resolve to the latest documentation. |
||
![ | ||
"TIME", | ||
"HH", | ||
"SS", | ||
"COMM", | ||
"DATEAMPM", | ||
"DATETIME", | ||
"NLDATMTM", | ||
"NLDATM", | ||
"NLDATMAP", | ||
"NLDATMW", | ||
].some((f) => format.includes(f)); | ||
|
||
const isTimeFormat = () => | ||
["TIME", "TIMAP", "HOUR", "HH", "MM", "SS", "NLDATMTM"].some((f) => | ||
format.includes(f), | ||
) && !["DATEAMPM", "DATETIME", "COMMA"].some((f) => format.includes(f)); | ||
|
||
const isDateTimeFormat = () => | ||
["DATEAMPM", "DATETIME", "NLDATM", "NLDATMAP", "NLDATMW"].some((f) => | ||
format.includes(f), | ||
); | ||
|
||
const isCurrencyFormat = () => | ||
["NLMNI", "NLMNL", "NLMNY", "YEN", "DOLLAR", "EURO"].some((f) => | ||
format.includes(f), | ||
); | ||
|
||
if (type !== "num") { | ||
return type; | ||
} | ||
|
||
if (isDateFormat()) { | ||
return "date"; | ||
} | ||
if (isTimeFormat()) { | ||
return "time"; | ||
} | ||
if (isDateTimeFormat()) { | ||
return "datetime"; | ||
} | ||
if (isCurrencyFormat()) { | ||
return "currency"; | ||
} | ||
|
||
return type; | ||
}; |
Uh oh!
There was an error while loading. Please reload this page.