Skip to content

Instantly share code, notes, and snippets.

@Ashley-Upson
Created November 26, 2017 08:07
Show Gist options
  • Save Ashley-Upson/e21d7bd0cc8e73c9e9b346e758e985c3 to your computer and use it in GitHub Desktop.
Save Ashley-Upson/e21d7bd0cc8e73c9e9b346e758e985c3 to your computer and use it in GitHub Desktop.
Facebook help - splitting a value into an array.
<script type="text/javascript">
var dates = document.getElementById("dates_input").value,
dates_split = dates.split(" - "),
start_date = dates_split[0],
end_date = dates_split[1];
console.log("First date: " + start_date);
console.log("Second date: " + end_date);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment