{"id":14975632,"url":"https://github.com/chapin666/mongoose-date-format","last_synced_at":"2025-04-30T04:30:57.582Z","repository":{"id":57302002,"uuid":"137051596","full_name":"chapin666/mongoose-date-format","owner":"chapin666","description":"date format plugin for mongoose","archived":false,"fork":false,"pushed_at":"2018-06-12T14:00:50.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T14:54:11.035Z","etag":null,"topics":["date-formate","eggjs","mongoose-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chapin666.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-12T09:50:37.000Z","updated_at":"2018-06-12T14:00:52.000Z","dependencies_parsed_at":"2022-09-07T00:10:25.389Z","dependency_job_id":null,"html_url":"https://github.com/chapin666/mongoose-date-format","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chapin666%2Fmongoose-date-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chapin666%2Fmongoose-date-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chapin666%2Fmongoose-date-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chapin666%2Fmongoose-date-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chapin666","download_url":"https://codeload.github.com/chapin666/mongoose-date-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224198017,"owners_count":17271999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date-formate","eggjs","mongoose-plugin"],"created_at":"2024-09-24T13:52:18.848Z","updated_at":"2024-11-12T00:38:52.954Z","avatar_url":"https://github.com/chapin666.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongoose-date-format\n\n### INSTALL\n```\nnpm install mongoose-date-format --save\n```\n\n### USE\n\n#### 1. define schema:\n```\n'use strict';\n\nmodule.exports = app =\u003e {\n  const mongoose = app.mongoose;\n\n  const UserSchema = new mongoose.Schema({\n    username: { type: String, required: true },\n    birthdate: { type: Date, default: new Date() },\n    ...\n  });\n\n  return mongoose.model('User', UserSchema);\n};\n\n```\n#### 2. added plugin:\n```\n'use strict';\n\nconst mongooseDateFormat = require('mongoose-date-format');\n\nmodule.exports = app =\u003e {\n  const mongoose = app.mongoose;\n\n  const UserSchema = new mongoose.Schema({\n    username: { type: String, required: true },\n    ...\n  });\n  \n  UserSchema.plugin(mongooseDateFormat);  // format: YYYY-MM-DD HH:mm:ss\n  return mongoose.model('User', UserSchema);\n};\n```\n\n#### 3. response format:\n```\n{\n  username: 'test',\n  birthdate: '2018-02-12 19:23:45',\n  ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchapin666%2Fmongoose-date-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchapin666%2Fmongoose-date-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchapin666%2Fmongoose-date-format/lists"}