feat: scaffold BuildPulse v0.1 cockpit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
export const nowIso = () => new Date().toISOString()
|
||||
|
||||
export const formatDateTime = (value: string) => {
|
||||
try {
|
||||
return new Intl.DateTimeFormat(undefined, {
|
||||
dateStyle: 'medium',
|
||||
timeStyle: 'short',
|
||||
}).format(new Date(value))
|
||||
} catch {
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
export const linesToArray = (value: string) =>
|
||||
value
|
||||
.split('\n')
|
||||
.map((line) => line.trim())
|
||||
.filter(Boolean)
|
||||
|
||||
export const arrayToLines = (value: string[]) => value.join('\n')
|
||||
|
||||
export const slugify = (value: string) =>
|
||||
value
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]+/g, '_')
|
||||
.replace(/^_+|_+$/g, '') || 'item'
|
||||
Reference in New Issue
Block a user