Change from deadlines to scheduled
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -182,3 +182,4 @@ flycheck_*.el
|
||||
|
||||
|
||||
tasks.org
|
||||
org-todo-pwa.code-workspace
|
||||
|
||||
@@ -4,13 +4,13 @@ document.getElementById('taskForm').addEventListener('submit', function(e) {
|
||||
// Get form values
|
||||
const subject = document.getElementById('subject').value;
|
||||
const description = document.getElementById('description').value;
|
||||
const deadline = document.getElementById('deadline').value;
|
||||
const scheduled = document.getElementById('scheduled').value;
|
||||
|
||||
// Structure data for Org mode
|
||||
const taskData = {
|
||||
subject,
|
||||
description,
|
||||
deadline
|
||||
scheduled
|
||||
};
|
||||
|
||||
// Send data to backend using fetch
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
<label for="description">Beskrivning:</label>
|
||||
<textarea id="description"></textarea><br><br>
|
||||
|
||||
<label for="deadline">Datum:</label>
|
||||
<input type="date" id="deadline" lang="sv-SE" required><br><br>
|
||||
<label for="scheduled">Datum:</label>
|
||||
<input type="date" id="scheduled" lang="sv-SE" required><br><br>
|
||||
|
||||
<button type="submit">Spara</button>
|
||||
</form>
|
||||
@@ -31,9 +31,9 @@
|
||||
<script>
|
||||
// Set today's date as the default for the date input
|
||||
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
|
||||
flatpickr("#deadline", {
|
||||
flatpickr("#scheduled", {
|
||||
locale: "sv", // Set Swedish locale
|
||||
weekNumbers: true, // Show week numbers
|
||||
firstDayOfWeek: 1 // Start weeks on Monday
|
||||
|
||||
@@ -11,12 +11,12 @@ app.use(express.static('public'));
|
||||
|
||||
// Endpoint to receive task data and append to file
|
||||
app.post('/add-task', (req, res) => {
|
||||
const { subject, description, deadline } = req.body;
|
||||
const { subject, description, scheduled } = req.body;
|
||||
|
||||
const orgFormattedData = `
|
||||
* TODO ${subject}
|
||||
${description}
|
||||
SCHEDULED: <${deadline}>
|
||||
SCHEDULED: <${scheduled}>
|
||||
`;
|
||||
|
||||
const filePath = path.join(__dirname, 'tasks.org');
|
||||
|
||||
Reference in New Issue
Block a user