Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
react-mobile-datepicker
Advanced tools
Using npm:
$ npm install react-mobile-datepicker --save
然后,使用模块加载工具流,支持common.js或ES2015模块,例如webpack
// Using an ES6 transpiler like Babel
import DatePicker from 'react-mobile-datepicker';
import 'react-mobile-datepicker/dist/mobile-datepicker.css'; // Make sure to import the default stylesheet
// Not using an ES6 transpiler
var DatePicker = require('react-mobile-datepicker');
require('react-mobile-datepicker/dist/mobile-datepicker.css');
import React, { Component } from 'react';
import { render } from 'react-dom';
import DatePicker from 'mobile-datepicker';
import 'react-mobile-datepicker/dist/mobile-datepicker.css'; // only needs to be imported once
// Render the Calendar
var today = new Date();
var minDate = Number(new Date()) - (24*60*60*1000) * 7; // One week before today
render(
<DatePicker
startDate={today}
minDate={minDate}
onSelect={(time) => { console.log(time); }} />,
document.getElementById('root')
);
Property | Type | Default | Description |
---|---|---|---|
btnColor | String | #fff | 完成按钮颜色 |
dateColor | String | #fff | 日期文字颜色 |
layerBackground | String | #ffa70b | 背景颜色 |
startDate | Date | new Date() | 初始日期 |
minDate | Date | 前一周 | 最小日期 |
maxDate | Date | new Date() | 最小日期 |
onSelect | Function | () => {} | 点击完成后的回调函数, Date对象作为参数 |
FAQs
一个移动端时间选择器react组件
The npm package react-mobile-datepicker receives a total of 4,925 weekly downloads. As such, react-mobile-datepicker popularity was classified as popular.
We found that react-mobile-datepicker 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
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.