const axios = require("axios");
const { splitSite } = require("../middlewares");
const db = require("../models");
const Timedata = db.timedata;
var moment = require('moment-timezone');

exports.getDocsByCondition1 = (req, res) => {
	const params = req.query;
	const date = params.date;
	const condition = {};
	condition['time'] = {
		//$gte: moment(parameter.date + 'T00:00:00.00').toDate()
		$gte: moment.tz(date + 'T00:00:00.00', "America/New_York").toDate()
	};
	Timedata.find(condition)
    .then(data => {
      res.send(data);
    })
    .catch(err => {
      res.status(500).send({
        message:
          err.message || "Some error occurred while retrieving time data."
      });
    });
}