This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Dynamic Snippets #33
Open
Description
I'd like to dynamically include the current date/time in a snippet for markdown.
The snippet would look something like this.
'.source.gfm':
'Header':
'prefix': 'header'
'body': 'My name - `Date.today.strftime('%D')`'
which would print:
My name - 4/2/14
Date.today.strftime('%D') is Ruby, the equivalent js a little longer (unless there's an easier way):
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();
curr_month++;
var curr_year = d.getFullYear();
console.log(curr_month + "/" + curr_date + "/" + curr_year);
Thoughts?
I originally posted this on the atom forum