Sha256: 2068c1dd1a02791eee7b4a29a56dd119124a519249f5fa2f5fffbf6e5e29009c

Contents?: true

Size: 890 Bytes

Versions: 19

Compression:

Stored size: 890 Bytes

Contents

import { formatMoment } from '../format/format';
import { hooks } from '../utils/hooks';

hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';

export function toString () {
    return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
}

export function toISOString () {
    var m = this.clone().utc();
    if (0 < m.year() && m.year() <= 9999) {
        if ('function' === typeof Date.prototype.toISOString) {
            // native implementation is ~50x faster, use it when we can
            return this.toDate().toISOString();
        } else {
            return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
        }
    } else {
        return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
    }
}

export function format (inputString) {
    var output = formatMoment(this, inputString || hooks.defaultFormat);
    return this.localeData().postformat(output);
}

Version data entries

19 entries across 19 versions & 4 rubygems

Version Path
active_record_survey_api-0.0.19 spec/test_app/vendor/assets/bower_components/moment/src/lib/moment/format.js
active_record_survey_api-0.0.18 spec/test_app/vendor/assets/bower_components/moment/src/lib/moment/format.js
active_record_survey_api-0.0.17 spec/test_app/vendor/assets/bower_components/moment/src/lib/moment/format.js
active_record_survey_api-0.0.14 spec/test_app/vendor/assets/bower_components/moment/src/lib/moment/format.js
active_record_survey_api-0.0.12 spec/test_app/vendor/assets/bower_components/moment/src/lib/moment/format.js
active_record_survey_api-0.0.11 spec/test_app/vendor/assets/bower_components/moment/src/lib/moment/format.js
active_record_survey_api-0.0.7 spec/test_app/vendor/assets/bower_components/moment/src/lib/moment/format.js
active_record_survey_api-0.0.6 spec/test_app/vendor/assets/bower_components/moment/src/lib/moment/format.js
date_picker-0.0.8 test/dummy/vendor/assets/components/moment/src/lib/moment/format.js
date_picker-0.0.7 test/dummy/vendor/assets/components/moment/src/lib/moment/format.js
sedge_cms-0.0.1 vendor/assets/components/moment/src/lib/moment/format.js
date_picker-0.0.6 test/dummy/vendor/assets/components/moment/src/lib/moment/format.js
date_picker-0.0.5 test/dummy/vendor/assets/components/moment/src/lib/moment/format.js
date_picker-0.0.4 test/dummy/vendor/assets/components/moment/src/lib/moment/format.js
date_picker-0.0.3 test/dummy/vendor/assets/components/moment/src/lib/moment/format.js
date_picker-0.0.2 test/dummy/vendor/assets/components/moment/src/lib/moment/format.js
date_picker-0.0.1 test/dummy/vendor/assets/components/moment/src/lib/moment/format.js
puppet-herald-0.8.1 lib/puppet-herald/public/bower_components/moment/src/lib/moment/format.js
puppet-herald-0.8.0 lib/puppet-herald/public/bower_components/moment/src/lib/moment/format.js