Updated date format displayed
This commit is contained in:
@@ -981,7 +981,7 @@ def generate_qr_code(data):
|
||||
return img_str
|
||||
|
||||
@app.template_filter('strftime')
|
||||
def strftime_filter(value, format='%Y-%m-%d'):
|
||||
def strftime_filter(value, format='%m/%d/%Y'):
|
||||
"""Format datetime/date/string as strftime"""
|
||||
if isinstance(value, str):
|
||||
if value.lower() == 'now':
|
||||
@@ -2142,7 +2142,7 @@ def qr_checkin(qr_url):
|
||||
'location': attendance.location_name,
|
||||
'location_event': qr_code.location_event,
|
||||
'check_in_time': attendance.check_in_time.strftime('%H:%M:%S'),
|
||||
'check_in_date': attendance.check_in_date.strftime('%Y-%m-%d'),
|
||||
'check_in_date': attendance.check_in_date.strftime('%m/%d/%Y'),
|
||||
'device_info': attendance.device_info,
|
||||
'ip_address': attendance.ip_address,
|
||||
'location_accuracy': location_accuracy,
|
||||
@@ -2476,7 +2476,7 @@ def attendance_report():
|
||||
})()
|
||||
|
||||
# Add today's date for template
|
||||
today_date = datetime.now().strftime('%Y-%m-%d')
|
||||
today_date = datetime.now().strftime('%m/%d/%Y')
|
||||
current_date_formatted = datetime.now().strftime('%B %d')
|
||||
|
||||
print("✅ Rendering attendance report template")
|
||||
|
||||
+2
-2
@@ -476,18 +476,18 @@ const DateTimeUtils = {
|
||||
formatDate: (dateString) => {
|
||||
const date = new Date(dateString);
|
||||
return date.toLocaleDateString("en-US", {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
});
|
||||
},
|
||||
|
||||
formatDateTime: (dateString) => {
|
||||
const date = new Date(dateString);
|
||||
return date.toLocaleString("en-US", {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
});
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="date-info">
|
||||
{{ record.check_in_date.strftime('%Y-%m-%d') }}
|
||||
{{ record.check_in_date.strftime('%m/%d/%Y') }}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user