]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Revert "Merge pull request #3666 from josephjaniga:calendar-overload-formats"
authorIskren Chernev <iskren.chernev@gmail.com>
Sat, 18 Mar 2017 20:25:41 +0000 (22:25 +0200)
committerIskren Chernev <iskren.chernev@gmail.com>
Sat, 18 Mar 2017 20:25:41 +0000 (22:25 +0200)
This reverts commit a2df2a309ae75d5a2d5ee44666261d8c8a92f804, reversing
changes made to a52400ec443c942a71584f3bdafddd2847423862.

src/lib/moment/calendar.js
src/test/moment/calendar.js

index 0046a49a4a0d8cea362d918fa645d97eda20d748..4b5725c58b0c17010d99f893995b4f067e80e467 100644 (file)
@@ -1,4 +1,3 @@
-import { isMoment } from './constructor';
 import { createLocal } from '../create/local';
 import { cloneWithOffset } from '../units/offset';
 import isFunction from '../utils/is-function';
@@ -15,11 +14,6 @@ export function getCalendarFormat(myMoment, now) {
 }
 
 export function calendar (time, formats) {
-    // Support for single parameter, formats only overload to the calendar function
-    if (arguments.length === 1 && typeof time === 'object' && !isMoment(time)) {
-        formats = arguments[0];
-        time = undefined;
-    }
     // We want to compare the start of today, vs this.
     // Getting start-of-today depends on whether we're local/utc/offset or not.
     var now = time || createLocal(),
index 98afd8645e08f0e2f20ad6970c357a4923218483..36af6848fa7ca2c1689eabaa73aaf021cdd73f0c 100644 (file)
@@ -55,12 +55,3 @@ test('extending calendar options', function (assert) {
         moment.updateLocale('en', null);
     }
 });
-
-test('calendar overload - passing one parameter formats', function (assert) {
-    var a = moment().hours(13).minutes(23).seconds(45);
-    assert.equal(moment(a).calendar({
-        'sameDay': function () {
-            return 'h:mm:ssA';
-        }
-    }), '1:23:45PM', 'should equate');
-});