How to use the moment-timezone.unix function in moment-timezone

To help you get started, we’ve selected a few moment-timezone examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github epam / cloud-pipeline / client / src / components / cluster / charts / charts-data / chart-data.js View on Github external
return new Promise(async (resolve) => {
    const fromValue = from
      ? moment.unix(from).utc().format('YYYY-MM-DD HH:mm:ss')
      : undefined;
    const toValue = to
      ? moment.unix(to).utc().format('YYYY-MM-DD HH:mm:ss')
      : undefined;
    const request = new NodeUsage(node, fromValue, toValue);
    await request.fetchIfNeededOrWait();
    resolve({
      error: request.error,
      value: request.value
    });
  });
}
github epam / cloud-pipeline / client / src / components / cluster / charts / charts-data / chart-data.js View on Github external
return new Promise(async (resolve) => {
    const fromValue = from
      ? moment.unix(from).utc().format('YYYY-MM-DD HH:mm:ss')
      : undefined;
    const toValue = to
      ? moment.unix(to).utc().format('YYYY-MM-DD HH:mm:ss')
      : undefined;
    const request = new NodeUsage(node, fromValue, toValue);
    await request.fetchIfNeededOrWait();
    resolve({
      error: request.error,
      value: request.value
    });
  });
}
github moovel / teamchatviz / server / data / lib / sync / lib / channels.js View on Github external
.then(ch => {
                if (!ch) {
                  return saveChannel({
                    id: getters.getChannelId(channel.id),
                    teamId: getters.getTeamId(teamId),
                    name: getters.getChannelName(channel.name),
                    topic: getters.getChannelTopic(channel.topic),
                    purpose: getters.getChannelPurpose(channel.purpose),
                    numberOfMembers: channel.members.length,
                    creationDate: moment.unix(channel.created),
                    createdBy: getters.getMemberId(channel.creator),
                  });
                }
              });
          });
github nylas-mail-lives / nylas-mail / internal_packages / composer-scheduler / lib / composer / proposed-time-list.jsx View on Github external
_renderProposalTimeText(proposal) {
    const start = moment.unix(proposal.start).format("LT")
    const end = moment.unix(proposal.end).add(1, 'second').format("LT")
    const tz = <span style="{{fontSize:">{TZ}</span>
    const timestr = `${start}${end}`
    return <span>{timestr}&nbsp;&nbsp;{tz}</span>
  }
github BrandonCookeDev / smashgg.js / src / v4 / ts / lib / GGSet.ts View on Github external
getCompletedAt() : Date | null {
		if(this.completedAt)
			return moment.unix(this.completedAt).toDate();
		else return null
	}
github PokemonGoers / PredictPokemon-2 / feature_sources / weather_clean.js View on Github external
var sunTimeFeatures = (function (sunTimestamp, currentTimestamp, timezone) {
        var sunDate = moment.unix(sunTimestamp).tz(timezone);
        var currentDate = moment.unix(currentTimestamp).tz(timezone);
        return {
            "minutesSinceMidnight": minutesSinceMidnight(sunDate),
            "hour": sunDate.hours(),
            "minute": sunDate.minutes(),
            "minutesSince": minutesSinceMidnight(currentDate) - minutesSinceMidnight(sunDate)
        };
    });
    var minutesSinceMidnight = (function (momentDate) {
github Uninett / Foodle / www / res / js2 / models / Foodle.js View on Github external
"locked": function() {

			if (!this.expire) return false;

			var now = moment();
			var deadline = moment.unix(parseInt(this.expire, 10));
			return (now > deadline);
		},