Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
});
});
}
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
});
});
}
.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),
});
}
});
});
_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} {tz}</span>
}
_eventStart() {
return moment.unix(this.props.event.start || moment().unix())
}
_eventStart() {
return moment.unix(this.props.event.start || moment().unix())
}
getCompletedAt() : Date | null {
if(this.completedAt)
return moment.unix(this.completedAt).toDate();
else return null
}
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) {
"locked": function() {
if (!this.expire) return false;
var now = moment();
var deadline = moment.unix(parseInt(this.expire, 10));
return (now > deadline);
},