This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Anniversaries v1.1 Jan 2019 | |
let currentMonth = new Date().getMonth(); | |
let startDate = new Date(new Date().setMonth(currentMonth-6)); | |
// Add two months from today to show some upcoming anniversaries | |
let endDate = new Date(new Date().setMonth(currentMonth+7)); | |
// Add a convenience function for brief month names | |
Date.prototype.getMonthName = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// - JW Library lookup #scripts | |
const e = editor; | |
let line_range = e.getSelectedLineRange(); | |
let eol = line_range[0] + line_range[1]; | |
if (e.getTextInRange(eol - 1, 1) === '\n' ) { | |
eol = eol - 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let dailyText = await loadText() | |
if (config.runsInWidget) { | |
let widget = createWidget(dailyText) | |
Script.setWidget(widget) | |
Script.complete() | |
} else { | |
Safari.open(dailyText.wtlibUrl); | |
} |