Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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 | 背景颜色 |
date | Date | new Date() | 初始日期 |
minDate | Date | 前一周 | 最小日期 |
maxDate | Date | new Date() | 最大日期 |
onSelect | Function | () => {} | 点击完成后的回调函数, Date对象作为参数 |
FAQs
一个移动端时间选择器react组件
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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.