Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-simple-date-picker
Advanced tools
A simple, modular React date picker component
The package can be installed via NPM:
npm i -S react-simple-date-picker
import React from 'react';
import DatePicker from 'react-simple-date-picker';
const MyForm = () => (
<form className="MyForm" onSubmit={(e) => {
const dateInput = e.target.querySelectorAll('input[name$="date"]')[0];
// dateInput.value is formatted as a YYYY-MM-DD string by default
doSomething(dateInput.value);
}}>
<DatePicker />
<button type="submit">Submit</button>
</form>
);
export default MyForm;
This DatePicker component is built simple on purpose. It's intended to be built upon. However, there are some pieces that are customizable right out of the box.
These customizable props include:
dirty
: should the currently selected date be shown on mount [defaults to true
]inputName
: the html input element's "name" property [defaults to 'date'
]showDateReset
: show the reset button [defaults to true
]showDateSelected
: show the currently selected date in a human readable string [defaults to true
]showWeekDayName
: show the abbreviated week names at the top of the calendar [defaults to true
]showMonthChangeButtons
: show the left/right arrow buttons for changing the month [defaults to true
]showYearChangeButtons
: show the up/down arrow buttons for changing the year [defaults to true
]initialDate
: the initially selected date (Date) [defaults to new Date()
] ...
<DatePicker
inputName="MyForm_date"
showDateReset=false
showDateSelected=false
initialDate={new Date('2021-01-20')}
/>
...
If you'd like to build upon the existing component (and you should!), you can
find all the applicable files within the src
directory, with all the React
components located within the components
directory.
Before you begin hacking away, run npm i
at the root level directory.
This will get you setup with webpack and the necessary loaders so you can run a dev server and create a build when the time is right.
npm start
to start a dev server
npm run build
to create a production build
npm run build-dev
to create a dev build
FAQs
react-simple-date-picker
We found that react-simple-date-picker 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.