diff --git a/static/js/utils.js b/static/js/utils.js new file mode 100644 index 0000000..90bea88 --- /dev/null +++ b/static/js/utils.js @@ -0,0 +1,15 @@ +// Utility functions for DocuPulse + +/** + * Formats a Unix timestamp into a localized date and time string + * @param {number} ts - Unix timestamp in seconds + * @returns {string} Formatted date and time string + */ +function formatDate(ts) { + if (!ts) return ''; + const d = new Date(ts * 1000); + return d.toLocaleDateString() + ' ' + d.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}); +} + +// Export the functions +export { formatDate }; \ No newline at end of file diff --git a/templates/rooms/room.html b/templates/rooms/room.html index f324e7e..90030c6 100644 --- a/templates/rooms/room.html +++ b/templates/rooms/room.html @@ -5,6 +5,7 @@ {% block content %} +
@@ -95,7 +96,9 @@ {% include 'components/overwrite_confirm_modal.html' %} {% include 'components/move_modal.html' %} -