mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
Add files via upload
This commit is contained in:
@@ -18,7 +18,14 @@ const ClockIcon = () => (
|
|||||||
|
|
||||||
const formatTimeLeft = (expiresAt: string, t: (key: string) => string): string => {
|
const formatTimeLeft = (expiresAt: string, t: (key: string) => string): string => {
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
const expires = new Date(expiresAt)
|
// Ensure UTC parsing - if no timezone specified, assume UTC
|
||||||
|
let expires: Date
|
||||||
|
if (expiresAt.includes('Z') || expiresAt.includes('+') || expiresAt.includes('-', 10)) {
|
||||||
|
expires = new Date(expiresAt)
|
||||||
|
} else {
|
||||||
|
// No timezone - treat as UTC
|
||||||
|
expires = new Date(expiresAt + 'Z')
|
||||||
|
}
|
||||||
const diffMs = expires.getTime() - now.getTime()
|
const diffMs = expires.getTime() - now.getTime()
|
||||||
|
|
||||||
if (diffMs <= 0) return ''
|
if (diffMs <= 0) return ''
|
||||||
|
|||||||
@@ -36,7 +36,14 @@ const ServerIcon = () => (
|
|||||||
// Helper functions
|
// Helper functions
|
||||||
const formatTimeLeft = (expiresAt: string): string => {
|
const formatTimeLeft = (expiresAt: string): string => {
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
const expires = new Date(expiresAt)
|
// Ensure UTC parsing - if no timezone specified, assume UTC
|
||||||
|
let expires: Date
|
||||||
|
if (expiresAt.includes('Z') || expiresAt.includes('+') || expiresAt.includes('-', 10)) {
|
||||||
|
expires = new Date(expiresAt)
|
||||||
|
} else {
|
||||||
|
// No timezone - treat as UTC
|
||||||
|
expires = new Date(expiresAt + 'Z')
|
||||||
|
}
|
||||||
const diffMs = expires.getTime() - now.getTime()
|
const diffMs = expires.getTime() - now.getTime()
|
||||||
|
|
||||||
if (diffMs <= 0) return 'Истекло'
|
if (diffMs <= 0) return 'Истекло'
|
||||||
|
|||||||
Reference in New Issue
Block a user