Change from deadlines to scheduled
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -182,3 +182,4 @@ flycheck_*.el
|
|||||||
|
|
||||||
|
|
||||||
tasks.org
|
tasks.org
|
||||||
|
org-todo-pwa.code-workspace
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user