Permalink
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (13 sloc) 283 Bytes
title version signature
As JSON
2.9.0
moment.duration().toJSON();

When serializing a duration object to JSON, it will be represented as an ISO8601 string.

JSON.stringify({
    postDuration : moment.duration(5, 'm')
}); // '{"postDuration":"PT5M"}'