Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pandaman

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pandaman

一个简单易上手的工具库

  • 0.3.2
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

pandaman

一个简单易上手的工具库

install

$ npm install --save pandaman

API

date

这是一个柯里化的方法,用例如下 Standard Date and Time Format Specifiers

FormatDescriptionExample
sThe seconds of the minute between 0-59."0" to "59"
ssThe seconds of the minute with leading zero if required."00" to "59"
mThe minute of the hour between 0-59."0" or "59"
mmThe minute of the hour with leading zero if required."00" or "59"
hThe hour of the day between 1-12."1" to "12"
hhThe hour of the day with leading zero if required."01" to "12"
HThe hour of the day between 0-23."0" to "23"
HHThe hour of the day with leading zero if required."00" to "23"
dThe day of the month between 1 and 31."1" to "31"
ddThe day of the month with leading zero if required."01" to "31"
dddAbbreviated day name. Date.!CultureInfo.abbreviatedDayNames."Mon" to "Sun"
ddddThe full day name. Date.!CultureInfo.dayNames."Monday" to "Sunday"
MThe month of the year between 1-12."1" to "12"
MMThe month of the year with leading zero if required."01" to "12"
MMMAbbreviated month name. Date.!CultureInfo.abbreviatedMonthNames."Jan" to "Dec"
MMMMThe full month name. Date.!CultureInfo.monthNames."January" to "December"
yyDisplays the year as a two-digit number."99" or "07"
yyyyDisplays the full four digit year."1999" or "2007"
tDisplays the first character of the A.M./P.M. designator. Date.!CultureInfo.amDesignator or Date.!CultureInfo.pmDesignator"A" or "P"
ttDisplays the A.M./P.M. designator. Date.!CultureInfo.amDesignator or Date.!CultureInfo.pmDesignator"AM" or "PM"
SThe ordinal suffix ("st, "nd", "rd" or "th") of the current day."st, "nd", "rd" or "th"

Example:

import { date } from 'pandaman'
console.log(date(new Date())('yyyy年 MM月 dd日')()); // 2019年 04月 09日
// or
console.log(date(new Date())('yyyy年 MM月 dd日').toString());
// or
console.log('' + date(new Date())('yyyy年 MM月 dd日')());

// 柯里化表达
console.log(date(new Date())('yyyy年 MM月 dd日')('柯里化: yy-MMMM-d')()); //2019年 04月 09日柯里化: 19-April-9 

被用于格式化的字符(y M d等)不能用于连接符

FAQs

Package last updated on 24 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc