Connect student profiles, defaults, and feedback records to the Rust API. Configure the WeChat AppID, custom tab bar, and local development workflow for version 0.1.0.
16 lines
594 B
TypeScript
16 lines
594 B
TypeScript
export function addMinutes(time: string, minutes: number): string {
|
|
const [hours, mins] = time.split(':').map(Number)
|
|
const total = (hours * 60 + mins + minutes) % (24 * 60)
|
|
const nextHours = Math.floor(total / 60)
|
|
const nextMinutes = total % 60
|
|
|
|
return `${String(nextHours).padStart(2, '0')}:${String(nextMinutes).padStart(2, '0')}`
|
|
}
|
|
|
|
export function formatUpdatedAt(timestamp: number): string {
|
|
const date = new Date(timestamp)
|
|
const hours = String(date.getHours()).padStart(2, '0')
|
|
const minutes = String(date.getMinutes()).padStart(2, '0')
|
|
return `${hours}:${minutes}`
|
|
}
|