matthewmueller / date

Date() for humans
http://matthewmueller.github.io/date/
1.48k stars 89 forks source link

Add context extensions. #37

Closed viktor-evdokimov closed 11 years ago

viktor-evdokimov commented 11 years ago

Consider setting up beginning and end date for tasks

Start: Next Monday End: Two weeks from Start

and start value to take from context.

bulkan commented 11 years ago

I'm not sure I understand what you want. Could you please provide an example code snippet to describe what you want ?

viktor-evdokimov commented 11 years ago

Something like

var startDate = date('next monday')

date.setContext({ start : startDate })

var endDate = date('two weeks from start')
matthewmueller commented 11 years ago

oh that'd be pretty easy to do with the context parameter. For right now you could just do:

var startdate = date('next monday');
var enddate = date('two weeks from now', startdate);

I'm down for adding date parsing support for the context argument if it's a string.

viktor-evdokimov commented 11 years ago

oh somehow I missed that from example.

matthewmueller commented 11 years ago

closing, will fix issue in #38