Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
dateparser-nlp
Advanced tools
Readme
Official website: https://dateparser.io Official documentation: https://dateparser.io/documentation
npm
Run:
npm install --save dateparser-nlp
Initialize with:
const dateparser = require('dateparser-nlp')
In order to work, you need to have an API key to use Date Parser. API keys can be obtained for free at https://dateparser.io. It is fast and simple. Once you have an API key, just run this to add the key to configuration:
dateparser.config( {apiKey: 'putyourAPIkeyhere'} )
If you are using U.S dating system (MM/DD/YYYY), use this command to set the date format correctly:
dateparser.config( {dateFormat: 'mdy'} )
If you are using International Date System (DD/MM/YYYY), you can use a similar setup:
dateparser.config( {dateFormat: 'dmy'} )
*Note: this is the default configuration, therefore this line is optional if you are not switching between formats.
dateparser.parse('I went shopping on the 24th Dec. 2017.', function(error, dates){
/* do what you want here */
}
This method does the same as the previous one, but on an array of sentences, giving back the results as an array of dates.
dateparser.parseBulk(
['I went shopping on the 24th Dec. 2017.','I loved the movie we saw yesterday'],
function(error, datesArray){
/*
do what you want here
datesArray[0] is result(s) for the first sentence
datesArray[1] is result(s) for the second sentence
...
*/
}
FAQs
Parse natural language sentences to dates equivalent.
The npm package dateparser-nlp receives a total of 3 weekly downloads. As such, dateparser-nlp popularity was classified as not popular.
We found that dateparser-nlp 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.