Skip to content

Instantly share code, notes, and snippets.

@paulozullu
Last active April 25, 2019 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulozullu/71c7dab29b12bedd328fd2c72762af6c to your computer and use it in GitHub Desktop.
Save paulozullu/71c7dab29b12bedd328fd2c72762af6c to your computer and use it in GitHub Desktop.
jquery and javascript tips

1 - Convert string to Date (dd/mm/aaaa)

var from = $("#datepicker").val().split("-");
var f = new Date(from[2], from[1] - 1, from[0]);

2 - Convert now date to Date

var time = Date.now();
var date = new Date(time);

3 - Fix

var popup = new Foundation.Reveal($('#myElement'));
popup.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment