Skip to content

Instantly share code, notes, and snippets.

import React from 'react';
import {Link} from 'react-router';
import HomeStore from '../page-stores/HomeStore'
import HomeActions from '../page-actions/HomeActions';
class Home extends React.Component {
constructor(props) {
super(props);
this.state = HomeStore.getState();
this.onChange = this.onChange.bind(this);
@JockPerkins
JockPerkins / getdates.js
Created January 19, 2017 14:49 — forked from miguelmota/getDates.js
Get dates in between two dates with JavaScript.
// Returns an array of dates between the two dates
var getDates = function(startDate, endDate) {
var dates = [],
currentDate = startDate,
addDays = function(days) {
var date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
return date;
};
while (currentDate <= endDate) {
<script>
// Add Date Stamp to form field
$( document ).ready(function() {
var currentDt = new Date();
var mm = currentDt.getMonth() + 1;
var dd = currentDt.getDate();
var yyyy = currentDt.getFullYear();
var date = mm + '/' + dd + '/' + yyyy;
console.log(date);