Change from deadlines to scheduled

This commit is contained in:
2025-01-23 18:42:32 +01:00
parent fb14bd1cee
commit a6787d50bc
4 changed files with 9 additions and 8 deletions

1
.gitignore vendored
View File

@@ -182,3 +182,4 @@ flycheck_*.el
tasks.org tasks.org
org-todo-pwa.code-workspace

View File

@@ -4,13 +4,13 @@ document.getElementById('taskForm').addEventListener('submit', function(e) {
// Get form values // Get form values
const subject = document.getElementById('subject').value; const subject = document.getElementById('subject').value;
const description = document.getElementById('description').value; const description = document.getElementById('description').value;
const deadline = document.getElementById('deadline').value; const scheduled = document.getElementById('scheduled').value;
// Structure data for Org mode // Structure data for Org mode
const taskData = { const taskData = {
subject, subject,
description, description,
deadline scheduled
}; };
// Send data to backend using fetch // Send data to backend using fetch

View File

@@ -19,8 +19,8 @@
<label for="description">Beskrivning:</label> <label for="description">Beskrivning:</label>
<textarea id="description"></textarea><br><br> <textarea id="description"></textarea><br><br>
<label for="deadline">Datum:</label> <label for="scheduled">Datum:</label>
<input type="date" id="deadline" lang="sv-SE" required><br><br> <input type="date" id="scheduled" lang="sv-SE" required><br><br>
<button type="submit">Spara</button> <button type="submit">Spara</button>
</form> </form>
@@ -31,9 +31,9 @@
<script> <script>
// Set today's date as the default for the date input // Set today's date as the default for the date input
const today = new Date().toISOString().split('T')[0]; const today = new Date().toISOString().split('T')[0];
document.getElementById('deadline').value = today; document.getElementById('scheduled').value = today;
// Initialize flatpickr with Swedish locale and Monday as the first day of the week // Initialize flatpickr with Swedish locale and Monday as the first day of the week
flatpickr("#deadline", { flatpickr("#scheduled", {
locale: "sv", // Set Swedish locale locale: "sv", // Set Swedish locale
weekNumbers: true, // Show week numbers weekNumbers: true, // Show week numbers
firstDayOfWeek: 1 // Start weeks on Monday firstDayOfWeek: 1 // Start weeks on Monday

View File

@@ -11,12 +11,12 @@ app.use(express.static('public'));
// Endpoint to receive task data and append to file // Endpoint to receive task data and append to file
app.post('/add-task', (req, res) => { app.post('/add-task', (req, res) => {
const { subject, description, deadline } = req.body; const { subject, description, scheduled } = req.body;
const orgFormattedData = ` const orgFormattedData = `
* TODO ${subject} * TODO ${subject}
${description} ${description}
SCHEDULED: <${deadline}> SCHEDULED: <${scheduled}>
`; `;
const filePath = path.join(__dirname, 'tasks.org'); const filePath = path.join(__dirname, 'tasks.org');