Instantly share code, notes, and snippets.

Embed
What would you like to do?
TUAW > TextExpander Date Snippet > Next Sunday
set theDate to (current date) + 1 * days
repeat until weekday of theDate = Sunday
set theDate to theDate + 1 * days
end repeat
set theDate to year of theDate & "-" & (text -2 thru -1 of ("0" & (month of theDate as integer))) & "-" & (text -2 thru -1 of ("0" & (day of theDate as integer))) as string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment