diff options
author | kartofen <mladenovnasko0@gmail.com> | 2022-08-28 23:22:15 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2022-08-28 23:22:15 +0300 |
commit | 9d952483f250a97cbeab4061fa1c4e68341b330f (patch) | |
tree | 9d094911dc5178db9375eaa661e7f4bf0d5bf2cc /src/lib/util.ts | |
parent | 35b06b4fc851192916e000ad5e7e2f458846448c (diff) |
posting thread and image works
Diffstat (limited to 'src/lib/util.ts')
-rw-r--r-- | src/lib/util.ts | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/util.ts b/src/lib/util.ts index a0734b9..b6dd442 100644 --- a/src/lib/util.ts +++ b/src/lib/util.ts @@ -1,23 +1,23 @@ export const creatorColor = (creatorid: string) => { - let parts = creatorid.split('-') - let ints = parts.map(function(d) { return parseInt(d,16) }) - let code = ints[0] + let parts = creatorid.split('-') + let ints = parts.map(function(d) { return parseInt(d,16) }) + let code = ints[0] - let blue = (code >> 16) & 31; - let green = (code >> 21) & 31; - let red = (code >> 27) & 31; - let foreColor = `border:5px solid rgb(${red << 3}, ${green << 3}, ${blue << 3});`; - return foreColor; + let blue = (code >> 16) & 31; + let green = (code >> 21) & 31; + let red = (code >> 27) & 31; + let foreColor = `border:5px solid rgb(${red << 3}, ${green << 3}, ${blue << 3});`; + return foreColor; }; export function formatTime(timestamp: number): string { - let date = new Date(timestamp); - let year = date.getFullYear(); - let month = date.getMonth() + 1; - let day = date.getDate(); - let time = date.toTimeString().split(' ')[0]; - let formattedTime = `${time}, ${day}/${month}/${year}` + let date = new Date(timestamp); + let year = date.getFullYear(); + let month = date.getMonth() + 1; + let day = date.getDate(); + let time = date.toTimeString().split(' ')[0]; + let formattedTime = `${time}, ${day}/${month}/${year}` - return formattedTime; + return formattedTime; } |