Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
remoteUserObject,
rewardFundObject,
dynamicGlobalPropertiesObject,
currentMedianHistoryPriceObject
]);
const activeCategory = queryString.parse(this.props.location.search).category;
const articlesList = typeof activeCategory !== 'undefined' ?
articles.data.filter(article => article.category === activeCategory) :
articles.data;
// If we've loaded all core objects...
if (hasLoadedRemoteUserObject) {
signupDate = fecha.format(
fecha.parse(
remoteUserObject.created.split('T')[0],
'YYYY-MM-DD'
),
'D MMMM YYYY'
);
if (typeof remoteUserObject === 'object'
&& Object.keys(remoteUserObject).length > 0) {
console.log();
if(remoteUserObject.json_metadata !== '' && Object.keys(JSON.parse(remoteUserObject.json_metadata)).length > 0 ){
remoteUserObjectMeta = JSON.parse(remoteUserObject.json_metadata).profile
coverImage = remoteUserObjectMeta.cover_image;
}
name = remoteUserObject.name;
displayName = name && name !== '' ? name : uppercaseFirst(match.params.username);
reputation = repLog10(parseFloat(remoteUserObject.reputation));
var selectedDate = this.props.selectedDate;
var currentDate = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate(), 0, 0, 0, 0).valueOf();
var prevMonth = new Date(year, month - 1, 28, 0, 0, 0, 0);
var day = dateUtils.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
prevMonth.setDate(day);
prevMonth.setDate(day - (prevMonth.getDay() - weekStart + 7) % 7);
var nextMonth = new Date(prevMonth);
nextMonth.setDate(nextMonth.getDate() + 42);
nextMonth = nextMonth.valueOf();
var minDate = this.props.minDate && fecha.parse(this.props.minDate, this.props.format);
var maxDate = this.props.maxDate && fecha.parse(this.props.maxDate, this.props.format);
while (prevMonth.valueOf() < nextMonth) {
classes[this.prefixClass('day')] = true;
prevY = prevMonth.getFullYear();
prevM = prevMonth.getMonth();
// set className old new
if ((prevM < month && prevY === year) || prevY < year) {
classes[this.prefixClass('old')] = true;
} else if ((prevM > month && prevY === year) || prevY > year) {
classes[this.prefixClass('new')] = true;
}
parseDate(date, format = this.format) {
// Parse a date object
return fecha.parse(date, format);
}
formatValueToField(value) {
if (value != null) {
let dt = this.schema.format ? fecha.parse(value, this.schema.format) : new Date(value);
return fecha.format(dt, this.getDateFormat());
}
return value;
},
dateTime(
value: Date | string | number,
outputFormat: ?string = null,
inputFormat: string = "YYYY-MM-DDTHH:mm:ss.SSSZ"
): string {
if (!outputFormat) {
outputFormat = this.getDateTimeFormat();
}
if (!(value instanceof Date)) {
value = fecha.parse(value, inputFormat);
}
return fecha.format(value, outputFormat);
}
date(
value: Date | string | number,
outputFormat: ?string = null,
inputFormat: string = "Y-m-dTH:i:sO"
): string {
if (!outputFormat) {
outputFormat = this.getDateFormat();
}
if (!(value instanceof Date)) {
value = fecha.parse(value, inputFormat);
}
return fecha.format(value, outputFormat);
}
formatDatetimeToModel(newValue, oldValue) {
let defaultFormat = DATETIME_FORMATS[this.schema.inputType.toLowerCase()];
let m = fecha.parse(newValue, defaultFormat);
if (m !== false) {
if (this.schema.format) {
newValue = fecha.format(m, this.schema.format);
} else {
newValue = m.valueOf();
}
}
this.updateModelValue(newValue, oldValue);
},
formatDatetimeValueToField(value) {
export function parseDate(date: string | undefined) {
if (date) {
return fecha.parse(date, 'MM-DD-YY')
}
return null
}
parseDate: function (date) {
if (date) {
return fecha.parse(date, this.$options.dateFormat);
}
},
createItem: function (data) {
const parseDate = (val: string) => fecha.parse(val, 'YYYY-MM-DDTHH:mm:ssZZ')