How to use the isMoment function from moment-timezone

Find comprehensive JavaScript moment-timezone.isMoment code examples handpicked from public code repositorys.

47
48
49
50
51
52
53
54
55
56
  return path.join(dir, base.slice(0, pos) + str + base.slice(pos))
}

function closestYear (unknownDate, referenceDate) {
  // Convert to moment objects
  unknownDate = moment.isMoment(unknownDate) ? unknownDate : moment.utc(unknownDate)
  referenceDate = moment.isMoment(referenceDate) ? referenceDate : moment.utc(referenceDate)

  // Set the year of unknownDate that places it closest to referenceDate
  const year = referenceDate.year()
fork icon38
star icon0
watch icon3

+ 3 other calls in file

100
101
102
103
104
105
106
107
108
109
}

function setMax(date) {
    maxDate = date;
    attrs.maxDate = datePickerUtils.createMoment(date);
    maxValid = moment.isMoment(date);
}

ngModel.$formatters.push(formatter);
ngModel.$parsers.unshift(parser);
fork icon3
star icon2
watch icon3

+ 11 other calls in file

22
23
24
25
26
27
28
29
30
31

exports.isTmpFile = isTmpFile;
exports.isHiddenFile = isHiddenFile;

exports.toDate = function(date) {
  if (!date || moment.isMoment(date)) return date;

  if (!(date instanceof Date)) {
    date = new Date(date);
  }
fork icon0
star icon0
watch icon8