express-handlebars

Mongoose Date Schema

守給你的承諾、 提交于 2019-12-11 16:53:34
问题 I am using MongoDB, Mongoose, Express and Express Handlebars. I have an <input type="date"> in my form, that posts to database, and my mongoose schema is defined like this: var recordsSchema = new mongoose.Schema ({ scheduled: Date, }); The form inserts the time, but the output looks something like this: Fri Oct 26 2018 00:00:00 GMT+0000 (UTC) I want to format it so it appears as: Fri Oct 26 2018 And not have anything else. I tried using toString() method in the Handlebars template, but it

Error: ENOENT: no such file or directory in express-handlebars

只谈情不闲聊 提交于 2019-12-11 14:53:18
问题 I am using express-handlebars to load dynamic content in NodeJS inside app.js const express = require("express"); const bodyParser = require("body-parser"); const path = require("path"); const pp = require("./util/path.js"); const adminRoutes = require("./routes/admin"); const shopRoutes = require("./routes/shop"); const expressHbs = require("express-handlebars"); const app = express(); app.engine("hbs",expressHbs()); app.set("view engine", "hbs"); app.set("views", "views"); app.use