1.1.1 • Published 3 years ago

zyf-gtool v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

zyf-gTool

My favorite tools JavaScript, including (date)

install

npm install zyf-gtool

use

import gTool from "zyf-gtool";  //var gTool = require("gTool");

<script type="text/javascript" src="../node_modules/zyf-gtool/dist/gTool.js"></script>

api

date(日期类型)

dateFormat

desc: 日期格式转换

use: gTool.dateFormat(date, type)

type:

column0resultdesc
hh01
mm11
ss23
yyyy-mm-dd2021-01-02年月日
yyyy-mm-dd hh:mm2021-01-02 14:01年-月-日 时:分
yyyy-mm-dd hh:mm:ss2021-01-02 14:01:23年-月-日 时:分:秒
yyyy/mm/dd2021/01/02年/月/日
yyyy/mm/dd hh:mm2021/01/02 14:01年/月/日 时:分
yyyy/mm/dd hh:mm:ss2021/01/02 14:01:23年/月/日 时:分:秒

paddingZero

desc: 补0

use: gTool.paddingZero(date, type)

symbolChange

desc: 转换为Date对象,这里面的date可以是任何

use: gTool.symbolChange(date)

getBetweenDate

desc: 获取两个日期之间的所有日期

use: gTool.getBetweenDate(start, end)

getRecentDayDate

desc: 获取最近几天的日期

use: gTool.getRecentDayDate(天数)

getRecentDayDate

desc: 获取最近几年的日期

use: gTool.getRecentYearDate(年数)

getRecentMonthsDate

desc: 获取最近几月的日期

use: gTool.getRecentMonthsDate(月数)

getDayDiff

desc: 获取两个日期之间的天数

use: gTool.getDayDiff(start, end)

getDayDiffDayHourMinutesSecond

desc: 获取两个日期之间的天数/小时/分钟/秒数

use: gTool.getDayDiffDayHourMinutesSecond(start, end)

callback: {day:'', hour:'', minutes:'', sec: ''}

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago