🚨 Shai-Hulud Strikes Again:More than 500 packages and 700+ versions compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

date-fns-start-of

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-fns-start-of

A collection of the date-fns startOf functions to mirror moment's startOf function.

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
6
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

A collection of the date-fns startOf functions to mirror moment's startOf function.

Installation

    npm install date-fns-start-of --save

Usage

Simply add your date as the first argument, and the startOf type as your second argument and you're done!

dateFnsStartOf(Date, StartOfType one of 'second' 'minute' 'hour' 'day' 'week' 'ISOweek' month 'year' or 'ISOyear');

var dateFnsStartOf = require('date-fns-startOf');

var origDate = new Date('October 13, 2014 11:13:00');
var startMonth = dateFnsStartOf(origDate, 'month');

// startMonth = 'October 1, 2014 12:00:00'

Credits

Built using nothing but the excellent date-fns library.

FAQs

Package last updated on 10 Mar 2017

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