Skip to content
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
Open
@rgardner

Description

@rgardner

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions