Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
}
}
TimeSlider.propTypes = {
// defaultBrushExtent: PropTypes.arrayOf(PropTypes.number),
onBrushEnd: PropTypes.func,
xSpan: PropTypes.number,
};
TimeSlider.defaultProps = {
defaultBrushExtent: [
timeWeek.offset(timeDay.floor(new Date()), -1).getTime(),
timeDay.floor(new Date()).getTime(),
], // today and today minus thirty-one days
onBrushEnd: newExtent => console.log(newExtent),
xSpan: 2, // in years
};
export default TimeSlider;
/>}
);
}
}
TimeSlider.propTypes = {
// defaultBrushExtent: PropTypes.arrayOf(PropTypes.number),
onBrushEnd: PropTypes.func,
xSpan: PropTypes.number,
};
TimeSlider.defaultProps = {
defaultBrushExtent: [
timeWeek.offset(timeDay.floor(new Date()), -1).getTime(),
timeDay.floor(new Date()).getTime(),
], // today and today minus thirty-one days
onBrushEnd: newExtent => console.log(newExtent),
xSpan: 2, // in years
};
export default TimeSlider;
title: event.title,
description: event.metaDescription,
url: `${PUBLIC_BASE_URL}/veranstaltung/${event.slug}`,
image: `${CDN_FRONTEND_BASE_URL}/static/social-media/logo.png`
}}
/>
<a>{t('events/all')}</a>
)
}
const today = timeDay.floor(new Date())
const upcoming = events
.filter(event => today <= event.__parsedDate)
.sort((a, b) => ascending(a.__parsedDate, b.__parsedDate))
const past = events
.filter(event => today > event.__parsedDate)
.sort((a, b) => descending(a.__parsedDate, b.__parsedDate))
return (
<content>
</content>
constructor() {
super();
const now = timeDay.floor(new Date());
this.initialBrushExtent = [
timeWeek.offset(now, -4).getTime(),
now.getTime(),
];
this.state = {
timeSpan: this.initialBrushExtent,
};
}
<div>
<a>{t('events/all')}</a>
</div>
)
}
const today = timeDay.floor(new Date())
const upcoming = events.filter(event => {
return today <= parseDate(event.date)
})
const past = events.filter(event => {
return today > parseDate(event.date)
})
return (
<div>
{!!upcoming.length && (
<h3></h3></div>
constructor() {
super();
const now = timeDay.floor(new Date());
this.initialBrushExtent = [
timeMonth.offset(now, -12).getTime(),
now.getTime(),
];
this.state = {
timeSpan: this.initialBrushExtent,
};
}
function spanOfYears(numYears) {
return [
timeYear.offset(timeDay.floor(new Date()), -1 * numYears).getTime(),
timeDay.floor(new Date()).getTime(),
];
}