MCPcopy Index your code
hub / github.com/simstudioai/sim / formatDateShort

Function formatDateShort

apps/sim/app/workspace/[workspaceId]/logs/utils.ts:180–203  ·  view source on GitHub ↗
(dateStr: string)

Source from the content-addressed store, hash-verified

178}
179
180export function formatDateShort(dateStr: string): string {
181 const hasTime = dateStr.includes('T')
182 const [datePart, timePart] = dateStr.split('T')
183 const [, month, day] = datePart.split('-').map(Number)
184 const months = [
185 'Jan',
186 'Feb',
187 'Mar',
188 'Apr',
189 'May',
190 'Jun',
191 'Jul',
192 'Aug',
193 'Sep',
194 'Oct',
195 'Nov',
196 'Dec',
197 ]
198 const dateLabel = `${months[month - 1]} ${day}`
199 if (hasTime && timePart) {
200 return `${dateLabel} ${timePart.slice(0, 5)}`
201 }
202 return dateLabel
203}
204
205export const formatDate = (dateString: string) => {
206 const date = new Date(dateString)

Callers 3

LogsFunction · 0.90
LogsFilterPanelFunction · 0.90
AuditLogsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected