New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

date-floor

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-floor

Like Math.floor but for Date objects

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
6
50%
Maintainers
1
Weekly downloads
 
Created
Source

date-floor

Build status

Like Math.floor but for Date objects

installation

$ npm install date-floor

usage

Take a date any get back one that is the closest preceding:

  • year
  • month
  • day
  • hour
  • minute
var datefloor = require('date-floor');

var d = new Date('05/06/2014 11:56:45');


// 01/01/2014 00:00:00
var year = datefloor(d, 'year');

// 05/01/2014 00:00:00
var month = datefloor(d, 'month');

// 05/06/2014 00:00:00
var day = datefloor(d, 'day');

// 05/06/2014 11:00:00
var hour = datefloor(d, 'hour');

// 05/06/2014 11:56:00
var minute = datefloor(d, 'minute');

license

MIT

Keywords

date

FAQs

Package last updated on 08 Apr 2014

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