New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tiny-moment

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-moment

tiny moment.js

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

tiny-moment

a tiny js date/time handler

Features

  • weights less than 2kb gzipped.
  • well tested
  • flexible parser and formatter

Install

yarn add tiny-moment

Usage

  1. format
import tinyMoment from 'tiny-moment';

tinyMoment.format('1995/2/7', 'yyyy.MM.dd'); // '1995.02.07'
tinyMoment.format('1995/2/7', 'yy:M:dd, HH'); // '95:2:07, 00'
  1. parse
import tinyMoment from 'tiny-moment';

tinyMoment.parse('2016-08-18', 'yyyy-MM-dd', 'MM-yyyy-dd, hh'); // '09-2016-18, 00'
tinyMoment.parse('2016-08-18', 'yyyy-MM-dd'); // a Date instance that represents '2016-08-18'

Apis

format

Arguments
  • string | object: The value to format. It must be a valid date string that Date.parse can recognize or an Date instance.
  • string: Target format
Return
  • string: String in the target format

parse

Arguments
  • string: The value to parse.
  • string: The format of the first param
  • string(Optional): Target format
Return
  • string | object: A date instance or a string in the target format

Todo

  • add add/subtract method
  • add escaped characters

Keywords

FAQs

Package last updated on 06 Apr 2018

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