Created
April 20, 2018 11:18
-
-
Save oki/1ffb356e7998fd7d412cd7becf8ff035 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dragEnd(data) { | |
| draftActivity.end = d3.event.x; | |
| draftActivity.container.remove(); | |
| console.log(`start: ${draftActivity.start}`); | |
| console.log(`end: ${draftActivity.end}`); | |
| // dragRampDateTime(new Date()); | |
| let periodStart = dragRampDateTime(draftActivity.start); | |
| let periodEnd = dragRampDateTime(draftActivity.end); | |
| console.log( periodStart ); | |
| console.log( periodEnd ); | |
| console.log( dragRampDateTime(draftActivity.start) ); | |
| console.log( dragRampDateTime(draftActivity.end) ); | |
| console.log( dragRampDateTime(draftActivity.start) ); | |
| console.log( dragRampDateTime(draftActivity.end) ); | |
| // let overLapped = data.map( function(activity) { return dateRangesOverlap(periodStart, periodEnd, activity.start_at, activity.end_at) } ); | |
| // d3.map(data).each(function(activity) { | |
| // var range = moment.range(periodStart, periodEnd); | |
| // var range2 = moment.range(activity.start_at, activity.end_at); | |
| // if (range.overlaps(range2)) { | |
| // console.log(activity); | |
| // } else { | |
| // console.log("Nie") | |
| // } | |
| // }) | |
| console.log(`end: ${d3.event.x}:${d3.event.y}`) ; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment