✨ MAJOR FEATURES: • Auto-zoom intelligence với smart bounds fitting • Enhanced 3D GPS markers với pulsing effects • Professional route display với 6-layer rendering • Status-based parking icons với availability indicators • Production-ready build optimizations 🗺️ AUTO-ZOOM FEATURES: • Smart bounds fitting cho GPS + selected parking • Adaptive padding (50px) cho visual balance • Max zoom control (level 16) để tránh quá gần • Dynamic centering khi không có selection 🎨 ENHANCED VISUALS: • 3D GPS marker với multi-layer pulse effects • Advanced parking icons với status colors • Selection highlighting với animation • Dimming system cho non-selected items 🛣️ ROUTE SYSTEM: • OpenRouteService API integration • Multi-layer route rendering (glow, shadow, main, animated) • Real-time distance & duration calculation • Visual route info trong popup 📱 PRODUCTION READY: • SSR safe với dynamic imports • Build errors resolved • Global deployment via Vercel • Optimized performance 🌍 DEPLOYMENT: • Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app • Bundle size: 22.8 kB optimized • Global CDN distribution • HTTPS enabled 💾 VERSION CONTROL: • MapView-v2.0.tsx backup created • MAPVIEW_VERSIONS.md documentation • Full version history tracking
1.6 KiB
Unicode Tokens
Starting with v2, format and parse use Unicode tokens.
The tokens are different from Moment.js and other libraries that opted to use custom formatting rules. While usage of a standard ensures compatibility and the future of the library, it causes confusion that this document intends to resolve.
Popular mistakes
There are 4 tokens that cause most of the confusion:
-
DandDDthat represent the day of a year (1, 2, ..., 365, 366) are often confused withdandddthat represent the day of a month (1, 2, ..., 31). -
YYandYYYYthat represent the local week-numbering year (44, 01, 00, 17) are often confused withyyandyyyythat represent the calendar year.
// ❌ Wrong!
format(new Date(), 'YYYY-MM-DD')
//=> 2018-10-283
// ✅ Correct
format(new Date(), 'yyyy-MM-dd')
//=> 2018-10-10
// ❌ Wrong!
parse('11.02.87', 'D.MM.YY', new Date()).toString()
//=> 'Sat Jan 11 1986 00:00:00 GMT+0200 (EET)'
// ✅ Correct
parse('11.02.87', 'd.MM.yy', new Date()).toString()
//=> 'Wed Feb 11 1987 00:00:00 GMT+0200 (EET)'
To help with the issue, format and parse functions won't accept
these tokens without useAdditionalDayOfYearTokens option for D and DD and
useAdditionalWeekYearTokens options for YY and YYYY:
format(new Date(), 'D', { useAdditionalDayOfYearTokens: true })
//=> '283'
parse('365+1987', 'DD+YYYY', new Date(), {
useAdditionalDayOfYearTokens: true,
useAdditionalWeekYearTokens: true
}).toString()
//=> 'Wed Dec 31 1986 00:00:00 GMT+0200 (EET)'