Giter Site home page Giter Site logo

timemanager's Introduction

TimeManager

使用方法暂时未更新......

[TOC]

时间函数库

功能列表:

  • getTimestamp- 获取指定日期的时间戳

  • getDateToFromatByStamp- 根据时间戳获取对应格式的时间

  • getWeekByTimestamp- 根据时间戳获取星期

  • getWeekByDate- 根据日期获取星期

  • getMonthArrByFixedLength- 根据参数获取该月份的前/ 后指定长度的月份集合

  • getDayArrByFixedLength- 根据参数获取指定长度的天数集合

  • getMonthOfDay- 获取某月有多少天

  • getYearOfDay- 获取某年有多少天

  • getFirstDayOfYear- 获取某年的第一天

  • getLastDayOfYear- 获取某年最后一天

  • getDayOfYear- 获取某个日期是当年中的第几天

  • getDayOfYearWeek- 获取某个日期在这一年的第几周

  • calcuteTimeDif- 计算两个时间之间的差值 返回指定格

1. 定义预设格式 + 时间格式format

/**
 * 预设格式
 */
export enum EDEFAULT_FROMATS {
  year = "yyyy",
  month = "yyyy-MM",
  date = "yyyy-MM-dd",
  time = "HH:mm:ss",
  datetime = "yyyy-MM-dd HH:mm:ss"
}
/**
 * 可选参数  可拼接
 */
export enum EDEFAULT_PARAMS_FORMATS {
  yyyy = "yyyy",
  MM = "MM",
  M = "M",
  dd = "dd",
  d = "d",
  D = "D",
  HH = "HH",
  H = "H",
  hh = "hh",
  h = "h",
  mm = "mm",
  m = "m",
  ss = "ss",
  s = "s",
  SSS = "SSS",
  SS = "SS",
  A = "A",
  a = "a"
}
  • 规则:

timemanager's People

Contributors

elk-song avatar

Stargazers

tengxiangchen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.