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

@beyonk/date-utils

Package Overview
Dependencies
Maintainers
3
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyonk/date-utils - npm Package Compare versions

Comparing version 4.0.1 to 4.1.0

12

CHANGELOG.json

@@ -5,2 +5,14 @@ {

{
"version": "4.1.0",
"tag": "@beyonk/date-utils_v4.1.0",
"date": "Fri, 21 May 2021 08:40:10 GMT",
"comments": {
"minor": [
{
"comment": "add days of month method"
}
]
}
},
{
"version": "4.0.1",

@@ -7,0 +19,0 @@ "tag": "@beyonk/date-utils_v4.0.1",

9

CHANGELOG.md
# Change Log - @beyonk/date-utils
This log was last generated on Wed, 12 May 2021 14:33:12 GMT and should not be manually modified.
This log was last generated on Fri, 21 May 2021 08:40:10 GMT and should not be manually modified.
## 4.1.0
Fri, 21 May 2021 08:40:10 GMT
### Minor changes
- add days of month method
## 4.0.1

@@ -6,0 +13,0 @@ Wed, 12 May 2021 14:33:12 GMT

@@ -102,2 +102,30 @@ import dayjs from 'dayjs/esm'

function getMonthDays (displayedMonth) {
const now = localDate()
const requestedMonth = displayedMonth.startOf('month')
const monthStart = requestedMonth.day()
const daysInMonth = requestedMonth.daysInMonth()
const calendarStart = requestedMonth.subtract(monthStart, 'days')
const tailDays = 7 - (daysInMonth + monthStart) % 7
const totalDays = monthStart + daysInMonth + tailDays
const days = {}
for (let d = 0; d < totalDays; d++) {
const date = calendarStart.add(d, 'days')
const dateString = date.format('YYYY-MM-DD')
days[dateString] = {
valid: d >= monthStart && d - monthStart + 1 <= daysInMonth,
date,
year: date.year(),
month: date.month() + 1,
day: date.date(),
dateString,
number: date.format('DD'),
isToday: date.isSame(now, 'day')
}
}
return days
}
export {

@@ -119,3 +147,4 @@ localDate,

timeToMins,
utcEquivalent
utcEquivalent,
getMonthDays
}

2

package.json
{
"name": "@beyonk/date-utils",
"version": "4.0.1",
"version": "4.1.0",
"description": "Beyonk Date Utils",

@@ -5,0 +5,0 @@ "author": "Antony Jones <aj@desirableobjects.co.uk>",

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