Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resultDate = simpleI.floor(inBetween);
resultDate = simpleI.round(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.offset(inBetween);
resultDate = simpleI.offset(inBetween, 3);
simpleI = simpleI.filter((d: Date) => { return d.getMonth() === 2; });
// count = simpleI.count(start, end); // Test fails, since .count(...) is not defined on Interval
// simpleI = simpleI.every(10); // Test fails, since .every(...) is not defined on Interval
// Test built-in factories and date array creator definitions ------------------
countableI = d3Time.timeMillisecond;
dateArray = d3Time.timeMilliseconds(start, end);
dateArray = d3Time.timeMilliseconds(start, end, 60000);
countableI = d3Time.timeSecond;
dateArray = d3Time.timeSeconds(start, end);
dateArray = d3Time.timeSeconds(start, end, 120);
countableI = d3Time.timeMinute;
dateArray = d3Time.timeMinutes(start, end);
dateArray = d3Time.timeMinutes(start, end, 5);
countableI = d3Time.timeHour;
dateArray = d3Time.timeHours(start, end);
dateArray = d3Time.timeHours(start, end, 2);
countableI = d3Time.timeDay;
dateArray = d3Time.timeDays(start, end);
resultDate = simpleI.floor(inBetween);
resultDate = simpleI.round(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.offset(inBetween);
resultDate = simpleI.offset(inBetween, 3);
simpleI = simpleI.filter((d: Date) => d.getMonth() === 2);
// count = simpleI.count(start, end); // Test fails, since .count(...) is not defined on Interval
// simpleI = simpleI.every(10); // Test fails, since .every(...) is not defined on Interval
// Test built-in factories and date array creator definitions ------------------
countableI = d3Time.timeMillisecond;
dateArray = d3Time.timeMilliseconds(start, end);
dateArray = d3Time.timeMilliseconds(start, end, 60000);
countableI = d3Time.timeSecond;
dateArray = d3Time.timeSeconds(start, end);
dateArray = d3Time.timeSeconds(start, end, 120);
countableI = d3Time.timeMinute;
dateArray = d3Time.timeMinutes(start, end);
dateArray = d3Time.timeMinutes(start, end, 5);
countableI = d3Time.timeHour;
dateArray = d3Time.timeHours(start, end);
dateArray = d3Time.timeHours(start, end, 2);
countableI = d3Time.timeDay;
dateArray = d3Time.timeDays(start, end);
resultDate = simpleI.floor(inBetween);
resultDate = simpleI.round(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.offset(inBetween);
resultDate = simpleI.offset(inBetween, 3);
simpleI = simpleI.filter((d: Date) => d.getMonth() === 2);
// count = simpleI.count(start, end); // Test fails, since .count(...) is not defined on Interval
// simpleI = simpleI.every(10); // Test fails, since .every(...) is not defined on Interval
// Test built-in factories and date array creator definitions ------------------
countableI = d3Time.timeMillisecond;
dateArray = d3Time.timeMilliseconds(start, end);
dateArray = d3Time.timeMilliseconds(start, end, 60000);
countableI = d3Time.timeSecond;
dateArray = d3Time.timeSeconds(start, end);
dateArray = d3Time.timeSeconds(start, end, 120);
countableI = d3Time.timeMinute;
dateArray = d3Time.timeMinutes(start, end);
dateArray = d3Time.timeMinutes(start, end, 5);
countableI = d3Time.timeHour;
dateArray = d3Time.timeHours(start, end);
dateArray = d3Time.timeHours(start, end, 2);
countableI = d3Time.timeDay;
dateArray = d3Time.timeDays(start, end);
dateArray = d3Time.timeDays(start, end, 2);
resultDate = simpleI.floor(inBetween);
resultDate = simpleI.round(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.offset(inBetween);
resultDate = simpleI.offset(inBetween, 3);
simpleI = simpleI.filter((d: Date) => { return d.getMonth() === 2; });
// count = simpleI.count(start, end); // Test fails, since .count(...) is not defined on Interval
// simpleI = simpleI.every(10); // Test fails, since .every(...) is not defined on Interval
// Test built-in factories and date array creator definitions ------------------
countableI = d3Time.timeMillisecond;
dateArray = d3Time.timeMilliseconds(start, end);
dateArray = d3Time.timeMilliseconds(start, end, 60000);
countableI = d3Time.timeSecond;
dateArray = d3Time.timeSeconds(start, end);
dateArray = d3Time.timeSeconds(start, end, 120);
countableI = d3Time.timeMinute;
dateArray = d3Time.timeMinutes(start, end);
dateArray = d3Time.timeMinutes(start, end, 5);
countableI = d3Time.timeHour;
dateArray = d3Time.timeHours(start, end);
dateArray = d3Time.timeHours(start, end, 2);
countableI = d3Time.timeDay;
dateArray = d3Time.timeDays(start, end);
dateArray = d3Time.timeDays(start, end, 2);
);
}
}
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;
const monthPathAndBBox = ({
date,
cellSize,
yearIndex,
yearSpacing,
daySpacing,
direction,
originX,
originY,
}) => {
// first day of next month
const t1 = new Date(date.getFullYear(), date.getMonth() + 1, 0)
// ranges
const firstWeek = timeWeek.count(timeYear(date), date)
const lastWeek = timeWeek.count(timeYear(t1), t1)
const firstDay = date.getDay()
const lastDay = t1.getDay()
// offset according to year index
let xO = originX
let yO = originY
const yearOffset = yearIndex * (7 * (cellSize + daySpacing) + yearSpacing)
if (direction === 'horizontal') {
yO += yearOffset
} else {
xO += yearOffset
}
let path
let bbox = { x: xO, y: yO, width: 0, height: 0 }
if (direction === 'horizontal') {
const monthPathAndBBox = ({
date,
cellSize,
yearIndex,
yearSpacing,
daySpacing,
direction,
originX,
originY,
}) => {
// first day of next month
const t1 = new Date(date.getFullYear(), date.getMonth() + 1, 0)
// ranges
const firstWeek = timeWeek.count(timeYear(date), date)
const lastWeek = timeWeek.count(timeYear(t1), t1)
const firstDay = date.getDay()
const lastDay = t1.getDay()
// offset according to year index
let xO = originX
let yO = originY
const yearOffset = yearIndex * (7 * (cellSize + daySpacing) + yearSpacing)
if (direction === 'horizontal') {
yO += yearOffset
} else {
xO += yearOffset
}
let path
let bbox = { x: xO, y: yO, width: 0, height: 0 }
render () {
if (!this.props.crowdfunding) {
return null
}
const {crowdfunding: {goals, status, endDate}, t} = this.props
const now = new Date()
const nextMinute = timeMinute.ceil(new Date())
// end date is expected to be an exact minute
// timeMinute.round is used to ensure that and
// support end dates like '2017-05-31 19:59:59.999+02'
const end = timeMinute.round(new Date(endDate))
const totalMinutes = timeMinute.count(nextMinute, end)
const minutes = totalMinutes % 60
const hours = Math.floor(totalMinutes / 60) % 24
const days = Math.floor(totalMinutes / 60 / 24)
if (!goals.length) {
return
}
const goalsByPeople = [].concat(goals)
.sort((a, b) => ascending(a.people, b.people))
const goal = goalsByPeople[goalsByPeople.length - 1]
const peopleLabel = t.elements('status/goal/people', {
count: (
<a> {</a>
crowdfundingName,
crowdfunding: { goals, status },
t,
money,
people,
memberships
} = this.props
const now = new Date()
const nextMinute = timeMinute.ceil(new Date())
// end date is expected to be an exact minute
// timeMinute.round is used to ensure that and
// support end dates like '2017-05-31 19:59:59.999+02'
const end = timeMinute.round(new Date(endDate))
const totalMinutes = timeMinute.count(nextMinute, end)
const minutes = totalMinutes % 60
const hours = Math.floor(totalMinutes / 60) % 24
const days = Math.floor(totalMinutes / 60 / 24)
if (!goals.length) {
return null
}
const goalsByPeople = []
.concat(goals)
.sort((a, b) => ascending(a.people, b.people))
const goal = goalsByPeople[goalsByPeople.length - 1]
const createHoverGoalCount = (format, value) => (