/Knockout-MomentJS-Punches

A forin binding for Knockout.JS that works like the foreach, iterating through an object's properties

Primary LanguageJavaScript

Knockout MomentJS Punches

A few simple Knockout Punches for date/time formatting

Given the following model:

myModel = {
	someDate : new Date('2/12/1986'),
	rightNow : new Date()
};

You could uses the punches as follows in a view bound against the model:

{{ someDate | fromNow }}  
{{ rightNow | date:'MMMM Do YYYY, h:mm:ss a' }}
{{ rightNow | addTime:'days':1 }}
{{ rightNow | subtractTime:'hours':3 }}