This is a script for Drafts.
This list will be sorted by days:
Tuesday. Chicken
Monday. Pasta
Sunday. Tacos
Script:
// Draft lines are sorted according to the order of the days array
// In each line, the day name must be followed by a dot then a space
// if some lines have no day name, they are placed at the beginning of draft
let days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'].map(d => d + '.');
draft.content = draft.lines.sort(function(a, b) {return days.indexOf(a.split(' ')[0]) - days.indexOf(b.split(' ')[0])}).join('\n');
draft.update();
Published in the Draft directory.