Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
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.
ambit
Advanced tools
Readme
#ambit
Date range parser
So it turns out I couldn't find anything out there that parsed a date string and returned a date range. Typically if you ask for "March" you get "March 1" instead of "March 1 through March 31"
This is an attempt at doing the latter.
Requires moment.
Season calculations done via moonbeams
Right now it only does day-level granularity.
var ambit = require('ambit'); //ambit is moment + ambit now;
var range = ambit.ambit('Spring 2005');
range will now either be undefined (unparseable input) or an object w/ a start
and end
attribute, which will be moment objects representing the start and end range of the input.
var ambit = require('ambit');
var range = ambit.ambit('Sept 2020', 'YYYY-MM-DD');
the start
and end
attributes will now be strings formatted YYYY-MM-DD
That's about it for now, it's pretty basic, probably has lots of edge-case bugs, and needs more tests.
If a year is not given, ambit will make every effort to assume the end date should be in the future. It also assumes you are giving dates in chronological order, so something like march 2015 to may 2011
will give unexpected results. The reason for this is so that something like oct to feb
will still work as expected (end will be feb of the year after the start date)
Because May 12
can be either May 2012
or May 12, current year
ambit assumes that two numbers following a month are a day unless preceeded by a \``. Seasons do not have this problem so
Spring 12is always interpreted as
Spring 2012. Also, something like
05on its own will still be interpreted as
2005`
License: MIT
FAQs
Date parser that returns a range instead of a single value
The npm package ambit receives a total of 15 weekly downloads. As such, ambit popularity was classified as not popular.
We found that ambit 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.
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.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.