Spaces:
Running
Running
remove created at and updated at field
Browse files- index.html +1 -13
- script.js +2 -11
index.html
CHANGED
|
@@ -66,19 +66,7 @@
|
|
| 66 |
</button>
|
| 67 |
</div>
|
| 68 |
</div>
|
| 69 |
-
|
| 70 |
-
<div>
|
| 71 |
-
<label for="createdAt" class="block text-sm font-medium text-gray-700 mb-1">Created At</label>
|
| 72 |
-
<input type="datetime-local" id="createdAt" name="createdAt"
|
| 73 |
-
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 transition">
|
| 74 |
-
</div>
|
| 75 |
-
|
| 76 |
-
<div>
|
| 77 |
-
<label for="updatedAt" class="block text-sm font-medium text-gray-700 mb-1">Updated At</label>
|
| 78 |
-
<input type="datetime-local" id="updatedAt" name="updatedAt"
|
| 79 |
-
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 transition">
|
| 80 |
-
</div>
|
| 81 |
-
</div>
|
| 82 |
|
| 83 |
<div class="flex justify-end space-x-4 pt-4">
|
| 84 |
<button type="reset" class="px-6 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition">
|
|
|
|
| 66 |
</button>
|
| 67 |
</div>
|
| 68 |
</div>
|
| 69 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
<div class="flex justify-end space-x-4 pt-4">
|
| 72 |
<button type="reset" class="px-6 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition">
|
script.js
CHANGED
|
@@ -3,14 +3,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
| 3 |
const jsonOutput = document.getElementById('jsonOutput');
|
| 4 |
const jsonContent = document.getElementById('jsonContent');
|
| 5 |
const copyButton = document.getElementById('copyJson');
|
| 6 |
-
|
| 7 |
-
// Set default dates to current time
|
| 8 |
-
const now = new Date();
|
| 9 |
-
const formattedNow = now.toISOString().slice(0, 16);
|
| 10 |
-
document.getElementById('createdAt').value = formattedNow;
|
| 11 |
-
document.getElementById('updatedAt').value = formattedNow;
|
| 12 |
-
|
| 13 |
-
form.addEventListener('submit', function(e) {
|
| 14 |
e.preventDefault();
|
| 15 |
|
| 16 |
const formData = new FormData(form);
|
|
@@ -19,9 +12,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
| 19 |
address: formData.get('address'),
|
| 20 |
phone: formData.get('phone'),
|
| 21 |
logoUrl: formData.get('logoUrl'),
|
| 22 |
-
|
| 23 |
-
updatedAt: new Date(formData.get('updatedAt')).toISOString()
|
| 24 |
-
};
|
| 25 |
|
| 26 |
// Display formatted JSON
|
| 27 |
jsonContent.textContent = JSON.stringify(data, null, 2);
|
|
|
|
| 3 |
const jsonOutput = document.getElementById('jsonOutput');
|
| 4 |
const jsonContent = document.getElementById('jsonContent');
|
| 5 |
const copyButton = document.getElementById('copyJson');
|
| 6 |
+
form.addEventListener('submit', function(e) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
e.preventDefault();
|
| 8 |
|
| 9 |
const formData = new FormData(form);
|
|
|
|
| 12 |
address: formData.get('address'),
|
| 13 |
phone: formData.get('phone'),
|
| 14 |
logoUrl: formData.get('logoUrl'),
|
| 15 |
+
};
|
|
|
|
|
|
|
| 16 |
|
| 17 |
// Display formatted JSON
|
| 18 |
jsonContent.textContent = JSON.stringify(data, null, 2);
|