WinJSContrib.Dates (NuGet package)

This package contains date related bindings. It relies on moment.js to help formatting dates.

To use this bindings, add references to moment.js and to the WinJSContrib parts:
<script src="/scripts/moment.js"></script>
<script src="/scripts/winjscontrib/mcnext.date.utils.js"></script>

You could now use custom bindings to format dates

<div data-win-bind="innerText : curDate MCNEXT.Bindings.formatDate" data-win-bind-args='{ "formatDate" : "L"}'></div>
<div data-win-bind="innerText : curDate MCNEXT.Bindings.formatDate" data-win-bind-args='{ "formatDate" : "DD-MM-YYYY HH:mm:ss"}'></div>

Last edited Mar 18, 2014 at 8:08 AM by gleborgne, version 2