
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
fordatetime
Advanced tools
DateTime utils.
npm i fordatetime //or yarn add fordatetime
import DateTime from 'fordatetime'
let datetime = new DateTime()
new Date().format('yyyy-MM-dd hh:mm:ss')
// 2023-07-29 11:48:17
new Date().prev(1e3 * 60 * 60 * 24)
// 2023-07-28 11:48:17
new Date().prevDay({ day: 5 })
// 2023-07-24 11:48:17
new Date().prevDay({ day: 5, isShowAll: true })
// [
// '2023-07-24 11:48:17',
// '2023-07-25 11:48:17',
// '2023-07-26 11:48:17',
// '2023-07-27 11:48:17',
// '2023-07-28 11:48:17'
// ]
new Date().prevDay({ day: 5, isShowAll: true, includeCurrent: true })
// [
// '2023-07-25 11:48:17',
// '2023-07-26 11:48:17',
// '2023-07-27 11:48:17',
// '2023-07-28 11:48:17',
// '2023-07-29 11:48:17'
// ]
new Date().prevMonth({ month: 5, includeCurrent: false, isShowAll: true })
// [
// '2023-08-31 14:57:02',
// '2023-09-30 14:57:02',
// '2023-10-31 14:57:02',
// '2023-11-30 14:57:02',
// '2023-12-31 14:57:02'
// ]
new Date().prevYear({ year: 5, includeCurrent: false, isShowAll: true })
// [
// '2018-07-29 14:57:57',
// '2019-07-29 14:57:57',
// '2020-07-29 14:57:57',
// '2021-07-29 14:57:57',
// '2022-07-29 14:57:57'
// ]
new Date().next(1e3 * 60 * 60 * 24)
// 2023-07-30 14:58:50
new Date().nextDay({ day: 5 })
// 2023-08-03 14:59:09
new Date().nextDay({ day: 5, isShowAll: true })
// [
// '2023-07-30 14:59:28',
// '2023-07-31 14:59:28',
// '2023-08-01 14:59:28',
// '2023-08-02 14:59:28',
// '2023-08-03 14:59:28'
// ]
new Date().nextDay({ day: 5, isShowAll: true, includeCurrent: true })
//[
// '2023-07-29 15:00:46',
// '2023-07-30 15:00:46',
// '2023-07-31 15:00:46',
// '2023-08-01 15:00:46',
// '2023-08-02 15:00:46'
//]
new Date().nextMonth({ month: 5, includeCurrent: false, isShowAll: true })
//[
// '2023-08-31 15:01:24',
// '2023-09-30 15:01:24',
// '2023-10-31 15:01:24',
// '2023-11-30 15:01:24',
// '2023-12-31 15:01:24'
//]
new Date().nextYear({ year: 5, includeCurrent: false, isShowAll: true })
//[
// '2023-07-29 15:01:53',
// '2024-07-29 15:01:53',
// '2025-07-29 15:01:53',
// '2026-07-29 15:01:53',
// '2027-07-29 15:01:53'
//]
milliseconds datetime.split({ startTime: new Date('2022-01-01 00:00:00'), endTime: new Date('2022-01-10 23:59:59'), gap: 1e3 * 60 * 60 * 24 })
//[
// '2022-01-01 00:00:00',
// '2022-01-02 00:00:00',
// '2022-01-03 00:00:00',
// '2022-01-04 00:00:00',
// '2022-01-05 00:00:00',
// '2022-01-06 00:00:00',
// '2022-01-07 00:00:00',
// '2022-01-08 00:00:00',
// '2022-01-09 00:00:00',
// '2022-01-10 00:00:00'
// ]
type values 'year' or 'day', default is 'year'timezone offset, default is 8 (8 is China Timezone) datetime.calc({ startTime: new Date('2022-01-01 00:00:00'), endTime: new Date('2022-11-10 23:59:59') })
// { year: 0, month: 10, day: 9, hour: 23, minutes: 59, seconds: 59 }
datetime.calc({ startTime: new Date('2022-01-01 00:00:00'), endTime: new Date('2022-11-10 23:59:59') ,type : 'day'})
// { day: 313, hour: 23, minutes: 59, seconds: 59 }
new Date().getWeek()
// 星期日
new Date().getWeek(['周日', '周一', '周二', '周三', '周四', '周五', '周六'])
// 周日
new Date().getRangeYear()
// { start: '2023-01-01 00:00:00', end: '2023-12-31 23:59:59' }
new Date().getRangeMonth()
// { start: '2023-07-01 00:00:00', end: '2023-07-31 23:59:59' }
new Date().getRangeWeek()
// { start: '2023-07-24 00:00:00', end: '2023-07-30 23:59:59' }
FAQs
DateTime utils.
The npm package fordatetime receives a total of 7 weekly downloads. As such, fordatetime popularity was classified as not popular.
We found that fordatetime demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.