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.
@gothassos/easepick-datetime
Advanced tools
Readme
This package does not need to be installed if you are using @easepick/bundle.
DateTime library for easepick
.
https://easepick.com/packages/datetime
Creates a JavaScript DateTime instance that represents a single moment in time.
Using: new DateTime(date, format, lang)
argument | type | default value | description |
---|---|---|---|
date | Date string number | null | Date object or date string or number (unix timestamp). |
format | string | 'YYYY-MM-DD' | Required when you provide date argument as string. Must match a string value for proper parsing. |
lang | string | 'en-US' | Affects month names (MMM , MMMM tokens). |
You can omit all arguments and call new DateTime()
. This will create a DateTime object represents the current date.
name | arguments | description |
---|---|---|
getWeek | - | Returns a week number of date |
clone | - | Returns a copy of date |
toJSDate | - | Returns Date object. |
inArray | (array, inclusivity) | Find DateTime object in passed DateTime array. |
isBetween | (date1, date2, inclusivity) | Check if a DateTime is between two other DateTime. |
isBefore | (date, unit) | Check if a DateTime is before another DateTime. unit are day , month , year . |
isSameOrBefore | (date, unit) | Check if a DateTime is before or the same as another DateTime. unit are day , month . |
isAfter | (date, unit) | Check if a DateTime is after another DateTime.. unit are day , month , year . |
isSameOrAfter | (date, unit) | Check if a DateTime is after or the same as another DateTime. unit are day , month . |
isSame | (date, unit) | Check if a DateTime is the same as another DateTime. unit are day , month . |
add | (duration, unit) | Mutates the original DateTime by adding unit. unit are day , month . |
subtract | (duration, unit) | Mutates the original DateTime by subtracting unit. unit are day , month . |
diff | (date, unit) | Returns diff between two DateTime. unit are day , month . |
format | (format, lang) | Format output. See tokens format for format argument. lang affects month names (MMM , MMMM tokens). |
Tokens are case-sensitive.
Token | Output | |
---|---|---|
Day of Month | D | 1 2 … 30 31 |
DD | 01 02 … 30 31 | |
Month | M | 1 2 … 11 12 |
MM | 01 02 … 11 12 | |
MMM | Jan Feb … Nov Dec | |
MMMM | January February … November December | |
Year | YY | 70 71 … 29 30 |
YYYY | 1970 1971 … 2029 2030 | |
Hours (24 hour time) | H | 0 1 … 22 23 |
HH | 01 02 … 22 23 | |
Minutes | m | 1 2 … 58 59 |
mm | 01 02 … 58 59 | |
Seconds | s | 1 2 … 58 59 |
ss | 01 02 … 58 59 |
FAQs
DateTime object for easepick.
The npm package @gothassos/easepick-datetime receives a total of 7 weekly downloads. As such, @gothassos/easepick-datetime popularity was classified as not popular.
We found that @gothassos/easepick-datetime demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.