{
  "_args": [
    [
      {
        "raw": "manba@^0.0.19",
        "scope": null,
        "escapedName": "manba",
        "name": "manba",
        "rawSpec": "^0.0.19",
        "spec": ">=0.0.19 <0.0.20",
        "type": "range"
      },
      "/Users/alicia/Documents/develop/github/umock/page"
    ]
  ],
  "_from": "manba@>=0.0.19 <0.0.20",
  "_id": "manba@0.0.19",
  "_inCache": true,
  "_location": "/manba",
  "_nodeVersion": "7.7.3",
  "_npmOperationalInternal": {
    "host": "packages-12-west.internal.npmjs.com",
    "tmp": "tmp/manba-0.0.19.tgz_1493982946965_0.38853074237704277"
  },
  "_npmUser": {
    "name": "vvpvvp",
    "email": "alias8516@sina.com.cn"
  },
  "_npmVersion": "4.4.4",
  "_phantomChildren": {},
  "_requested": {
    "raw": "manba@^0.0.19",
    "scope": null,
    "escapedName": "manba",
    "name": "manba",
    "rawSpec": "^0.0.19",
    "spec": ">=0.0.19 <0.0.20",
    "type": "range"
  },
  "_requiredBy": [
    "/",
    "/heyui",
    "/js-model"
  ],
  "_resolved": "https://registry.npmjs.org/manba/-/manba-0.0.19.tgz",
  "_shasum": "5f7994adcd445b35f54fc8c2489e37bc1391e384",
  "_shrinkwrap": null,
  "_spec": "manba@^0.0.19",
  "_where": "/Users/alicia/Documents/develop/github/umock/page",
  "author": {
    "name": "alias"
  },
  "bugs": {
    "url": "https://github.com/vvpvvp/manba/issues"
  },
  "dependencies": {},
  "description": "javascript 日期处理",
  "devDependencies": {},
  "directories": {},
  "dist": {
    "shasum": "5f7994adcd445b35f54fc8c2489e37bc1391e384",
    "tarball": "https://registry.npmjs.org/manba/-/manba-0.0.19.tgz"
  },
  "gitHead": "8ded585244105339bd81aeae5a62a2430d56416b",
  "homepage": "https://github.com/vvpvvp/manba#readme",
  "keywords": [
    "manba",
    "date"
  ],
  "license": "The MIT License",
  "main": "build/manba.js",
  "maintainers": [
    {
      "name": "vvpvvp",
      "email": "a8918929@sina.com.cn"
    }
  ],
  "name": "manba",
  "optionalDependencies": {},
  "readme": "\n# manba\n<img src=\"http://manba.ch-un.com/images/logo.png\" alt=\"manba\" width=\"100\"><br/>\n超级简洁的日期处理Util，比moment.js小很多。  \n![manba](https://img.shields.io/badge/manba-1.1.15-red.svg)\n\n## 官方网站\n\n[http://manba.ch-un.com](http://manba.ch-un.com)\n\n## 安装\n```\nnpm install manba\n```\n建议本地安装\n```\nnpm install --save manba\n```\n\n## NPM\n\n[https://www.npmjs.com/package/manba](https://www.npmjs.com/package/manba)\n\n## 文档\n### 初始化数据\n\n初始化的时候，对月份做了修补。\n\n`manba(String|Number|Date|Array)`\n\n```javascript\nmanba(1459235037).format() //秒 2016-03-29\nmanba(1459235037000).format() //毫秒 2016-03-29\nmanba([2016,12,23,4,3,5]).format(\"f\") \n//月份自动补充，执行：new Date(2016,11,23,4,3,5) 2016-12-23 04:03:05\nmanba([2015,12,3]).format(\"f\") \n//执行：new Date(2015,11,3) 2015-12-03\nmanba(\"2014-12-03\").format(\"f\") //2014-12-03 00:00:00\nmanba(\"2014-12-03 12:34\").format(\"f\") //2014-12-03 12:34:00\nmanba(\"2014-12-03 12:34:12\").format(\"f\") //2014-12-03 12:34:34\nmanba(\"20141203\").format(\"f\") //2014-12-03 00:00:00\nmanba(\"201412031223\").format(\"f\") //2014-12-03 12:23:00\n```\n\n### format\n格式化日期转换标准\n- YYYY/yyyy:年份\n- M:月份\n- MM:月份，个位补充0\n- D/d:天数\n- DD/dd:天数，个位补充0\n- H/h:小时\n- HH/hh:小时，个位补充0\n- m:分钟\n- mm:分钟，个位补充0\n- S/s:秒数\n- SS/ss:秒数，个位补充0\n- w:星期，返回中文：['日', '一', '二', '三', '四', '五', '六']\n- q:上下午，返回中文：['上午', '下午']\n\n#### 内置简洁的格式化\n- \"l\": \"YYYY-MM-DD\",\n- \"ll\": \"YYYY年MM月DD日\",\n- \"k\": \"YYYY-MM-DD hh:mm\",\n- \"kk\": \"YYYY年MM月DD日 hh点mm分\",\n- \"kkk\": \"YYYY年MM月DD日 hh点mm分 q\",\n- \"f\": \"YYYY-MM-DD hh:mm:ss\",\n- \"ff\": \"YYYY年MM月DD日 hh点mm分ss秒\",\n- \"fff\": \"YYYY年MM月DD日 hh点mm分ss秒 星期w\",\n- \"n\": \"MM-DD\",\n- \"nn\": \"MM月DD日\",\n\n```javascript\n//各种format\nmanba() // Tue Mar 29 2016 16:52:56 GMT+0800 (CST)\nmanba().toString() // Tue Mar 29 2016 16:52:56 GMT+0800 (CST)\nmanba().format() // 2016-03-29\nmanba().format(\"l\") // 2016-03-29\nmanba().format(\"ll\") // 2016年03月29日\nmanba().format(\"k\") // 2016-03-29 16:52\nmanba().format(\"kk\") // 2016年03月29日 16点52分\nmanba().format(\"kkk\") // 2016年03月29日 16点52分 下午\nmanba().format(\"f\") // 2016-03-29 16:52:56\nmanba().format(\"ff\") // 2016年03月29日 16点52分56秒\nmanba().format(\"fff\") // 2016年03月29日 16点52分56秒 星期二\nmanba().format(\"n\") // 03-29\nmanba().format(\"nn\") // 03月29日\nmanba().format(\"YYYY\") // 2016\n```\n#### 定制简洁格式\n\n```javascript\nmanba.config({\n    formatString: {\n        \"r\": \"YYYY\"\n    },\n    now:\"2016-07-11T18:42:34.453+08:00\"\n}\n\n//now参数可以设置前端与后端的时间差，这样前端也可以使用manba()获取当前时间。\n\nmanba().format(\"r\") // 2016\n\n```\n\n### 获取数值函数\n`month()`方法，对月份做了修补。\n\n```javascript\nmanba().year() //2016\nmanba().year(2018).format() //2018-03-29\nmanba().month() //2016-03-29\nmanba().month(4).format() //2016-04-29\nmanba().minutes() //59\nmanba().minutes(34)\nmanba().time() //1459242450800\nmanba().time(123131312321).format() //1973-11-26\nmanba().date() //29\nmanba().date(4).format() //2016-03-04\nmanba().isLeapYear() //是否为闰年 true\nmanba().toString()\n```\n\n### ISOString\n\n`toISOString()`方法，获取带时区的格式化字符串(例：2016-12-02T20:58:02+08:00)。\n可传递参数获取其他时区的格式化字符串。\n\n```javascript\n\nmanba(\"2016-07-23 12:12:12\").toISOString() //返回带时区的格式，2016-07-23T12:12:12+08:00\nmanba(\"2016-07-23 12:12:12\").toISOString(+7) //返回UTC+7的日期，2016-07-23T11:12:12+07:00\n\n```\n\n### distance\n\n`manba.distance(manba|String|Number|Date|Array,manba.TYPE)`\n\n```javascript\nmanba(\"2012-09-21\").distance(\"2012-09-20 23:59:59\") \n//两个日期间相隔天数，纠正日期计算偏差 1\n\nmanba(\"2012-09-21\").distance(\"2012-09-20 23:59:59\",manba.DAY) \n//两个日期间相隔天数 1\n\nmanba(\"2012-09-21\").distance(\"2012-08-20 23:59:59\",manba.MONTH) \n//两个日期间相隔月数 1\n\nmanba(\"2012-09-21\").distance(\"2011-09-20 23:59:59\",manba.YEAR) \n//两个日期间相隔年数 1\n\n```\n### add\n`add`方法，对日期做加减法，只有add函数，如果需要减法，则传递负数。\n`manba.add(Number,manba.TYPE)`\n\n```javascript\nmanba(\"2012-10-03 23:59:59\").add(1,manba.DAY).format(\"fff\")\n//2012年10月04日 23点59分59秒 星期四\n\nmanba(\"2012-10-03 23:59:59\").add(-1,manba.DAY).format(\"fff\")\n//2012年10月02日 23点59分59秒 星期二\n\nmanba(\"2012-10-03 23:59:59\").add(26,manba.MONTH).format(\"fff\")\n//2014年12月03日 23点59分59秒 星期三\n\nmanba(\"2012-10-03 23:59:59\").add(-1,manba.YEAR).format(\"fff\")\n//2011年10月03日 23点59分59秒 星期一\n\nmanba(\"2012-10-03 23:59:59\").add(1,manba.MINUTE).format(\"ff\")\n//2012年10月04日 00点00分59秒\n```\n\n### startOf\n`startOf`方法，做一定规则的时间处理，并返回结果。\n注：该处理并不修改原来的对象，请使用返回的对象处理。  \n`manba.startOf(manba.TYPE)`\n\n```javascript\nmanba(\"2012-10-03 23:59:59\").startOf(manba.DAY).format(\"fff\")\n//2012年10月03日 00点00分00秒 星期三\n\nmanba(\"2012-10-03 23:59:59\").startOf(manba.YEAR).format(\"fff\")\n//2012年01月01日 00点00分00秒 星期日\n\nmanba(\"2012-10-03 23:59:59\").startOf(manba.MONTH).format(\"fff\")\n//2012年10月01日 00点00分00秒 星期一\n\nmanba(\"2012-10-03 23:59:59\").startOf(manba.HOUR).format(\"fff\")\n//2012年10月03日 15点00分00秒 星期三\n\nmanba(\"2012-10-03 23:59:59\").startOf(manba.WEEK).format(\"fff\")\n//2012年09月30日 00点00分00秒 星期日\n\nmanba(\"2012-10-03 23:59:59\").startOf(manba.WEEK,manba.MONDAY).format(\"fff\")\n//2012年10月01日 00点00分00秒 星期一\n```\n\n\n### endOf\n`endOf`方法，做一定规则的时间处理，并返回结果。\n注：该处理并不修改原来的对象，请使用返回的对象处理。  \n`manba.endOf(manba.TYPE)`\n\n```javascript\nmanba(\"2012-10-03 23:59:59\").endOf(manba.DAY).format(\"ff\")\n//2012年10月03日 23点59分59秒\n\nmanba(\"2012-10-03 23:59:59\").endOf(manba.YEAR).format()\n//2012-12-31\n\nmanba(\"2012-10-03 23:59:59\").endOf(manba.MONTH).format()\n//2012-10-31\n\nmanba(\"2012-10-03 23:59:59\").endOf(manba.WEEK).format(\"fff\")\n//2012年10月06日 23点59分59秒 星期六\n\nmanba(\"2012-10-03 23:59:59\").endOf(manba.WEEK,manba.MONDAY).format(\"fff\")\n//2012年10月07日 23点59分59秒 星期日\n```\n\n### 星期数\n```javascript\n//获取当月的星期数\n//manba.SUNDAY 星期日开始\n//默认星期日\nmanba().getWeekOfMonth()\nmanba().getWeekOfMonth(manba.MONDAY)\n\n//获取当年的星期数\n//manba.MONDAY 星期一开始\nmanba().getWeekOfYear(manba.MONDAY)\n```\n\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/vvpvvp/manba.git"
  },
  "scripts": {
    "build": "babel ./manba.js -d build",
    "min": "babel build/manba.js --minified --no-babelrc -o build/manba.min.js",
    "test": "mocha --compilers js:babel-core/register ./test/*.js"
  },
  "version": "0.0.19"
}
