feat: establish teaching feedback mini program
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.
This commit is contained in:
15
utils/time.ts
Normal file
15
utils/time.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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}`
|
||||
}
|
||||
Reference in New Issue
Block a user