Spaces:
Sleeping
Sleeping
🗓️ Fix date display in Recent Trees - use created_at field
Browse files- Changed tree.timestamp to tree.created_at to match Supabase schema
- This fixes the 'Invalid Date' display in Recent Trees section
- Date formatting will now work correctly for all trees
The Supabase database returns 'created_at' but frontend was looking for 'timestamp'.
- static/app.js +1 -1
static/app.js
CHANGED
@@ -443,7 +443,7 @@ class TreeTrackApp {
|
|
443 |
${tree.scientific_name || tree.common_name || tree.local_name || 'Unnamed'}
|
444 |
<br> ${tree.latitude.toFixed(4)}, ${tree.longitude.toFixed(4)}
|
445 |
${tree.tree_code ? '<br> ' + tree.tree_code : ''}
|
446 |
-
<br> ${new Date(tree.
|
447 |
</div>
|
448 |
</div>
|
449 |
`).join('');
|
|
|
443 |
${tree.scientific_name || tree.common_name || tree.local_name || 'Unnamed'}
|
444 |
<br> ${tree.latitude.toFixed(4)}, ${tree.longitude.toFixed(4)}
|
445 |
${tree.tree_code ? '<br> ' + tree.tree_code : ''}
|
446 |
+
<br> ${new Date(tree.created_at).toLocaleDateString()}
|
447 |
</div>
|
448 |
</div>
|
449 |
`).join('');
|