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
var getTimeAgo = function(datestring) { | |
// Takes in any datestring that can be used with the Date() constructor: | |
// e.g., "10/22/15" or "Wed Nov 29 2015 13:42:33 GMT-0800 (PST)" | |
// and outputs a date like Twitter's datetimestamps. | |
var d1 = new Date(); | |
var d2 = new Date(datestring); | |
var timeAgo = d1.getTime()-d2.getTime(); | |
if ((timeAgo/1000/60/60/24) >= 1) { | |
// return full date: "Nov 10" if same year, or "10 Nov 2015" | |
var months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>art show label generator</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="https://fonts.googleapis.com/css?family=Playfair+Display:400,400i,900,900i" rel="stylesheet"> | |
<link rel="stylesheet" href="./main.css" /> | |
</head> |
OlderNewer