Socket
Socket
Sign inDemoInstall

date-and-time

Package Overview
Dependencies
0
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

6

package.json
{
"name": "date-and-time",
"version": "1.0.0",
"version": "1.0.1",
"description": "A Minimalist DateTime utility for Node.js and the browser",

@@ -49,6 +49,6 @@ "main": "date-and-time.js",

"expect.js": "^0.3.1",
"mocha": "^8.3.2",
"mocha": "^8.4.0",
"mocha-headless-chrome": "^3.1.0",
"rollup": "^2.44.0"
"rollup": "^2.50.5"
}
}

@@ -27,2 +27,5 @@ # date-and-time

- 1.0.1
- Updated dev dependencies to resolve vulnerability.
- 1.0.0

@@ -36,5 +39,2 @@ - **First stable release!**

- 0.14.1
- Fixed a bug characters inside square brackets `[]` are not validated.
## Usage

@@ -68,3 +68,3 @@

### NOTE
### Note

@@ -75,39 +75,39 @@ - If you want to use ES Modules in Node.js without a transpiler, you need to add `"type": "module"` in your `package.json` or change your file extension from `.js` to `.mjs`.

- [format](#formatdateObj-formatString-utc)
- [format](#formatdateobj-formatstring-utc)
- Formatting a Date and Time (Date -> String)
- [parse](#parsedateString-arg-utc)
- [parse](#parsedatestring-arg-utc)
- Parsing a Date and Time string (String -> Date)
- [compile](#compileformatString)
- [compile](#compileformatstring)
- Compiling a format string
- [preparse](#preparsedateString-arg)
- [preparse](#preparsedatestring-arg)
- Pre-parsing a Date and Time string
- [isValid](#isValidarg1-arg2)
- [isValid](#isvalidarg1-arg2)
- Validation
- [transform](#transformdateString-arg1-arg2-utc)
- [transform](#transformdatestring-arg1-arg2-utc)
- Transforming a Date and Time string (String -> String)
- [addYears](#addYearsdateObj-years)
- [addYears](#addyearsdateobj-years)
- Adding years
- [addMonths](#addMonthsdateObj-months)
- [addMonths](#addmonthsdateobj-months)
- Adding months
- [addDays](#addDaysdateObj-days)
- [addDays](#adddaysdateobj-days)
- Adding days
- [addHours](#addHoursdateObj-hours)
- [addHours](#addhoursdateobj-hours)
- Adding hours
- [addMinutes](#addMinutesdateObj-minutes)
- [addMinutes](#addminutesdateobj-minutes)
- Adding minutes
- [addSeconds](#addSecondsdateObj-seconds)
- [addSeconds](#addsecondsdateobj-seconds)
- Adding seconds
- [addMilliseconds](#addMillisecondsdateObj-milliseconds)
- [addMilliseconds](#addmillisecondsdateobj-milliseconds)
- Adding milliseconds

@@ -118,6 +118,6 @@

- [isLeapYear](#isLeapYeary)
- [isLeapYear](#isleapyeary)
- Whether year is leap year
- [isSameDay](#isSameDaydate1-date2)
- [isSameDay](#issamedaydate1-date2)
- Comparison of two dates

@@ -191,3 +191,3 @@

#### NOTE 1. Comments
#### Note 1. Comments

@@ -201,3 +201,3 @@ String in parenthese `[...]` in the `formatString` will be ignored as comments:

#### NOTE 2. Output as UTC
#### Note 2. Output as UTC

@@ -211,3 +211,3 @@ This function usually outputs a local date-time string. Set to true the `utc` option (the 3rd parameter) if you would like to get a UTC date-time string.

#### NOTE 3. More Tokens
#### Note 3. More Tokens

@@ -273,3 +273,3 @@ You can also define your own tokens. See [EXTEND.md](./EXTEND.md) for details.

#### NOTE 1. Invalid Date
#### Note 1. Invalid Date

@@ -286,3 +286,3 @@ If the function fails to parse, it will return `Invalid Date`. Notice that the `Invalid Date` is a Date object, not `NaN` or `null`. You can tell whether the Date object is invalid as follows:

#### NOTE 2. Input as UTC
#### Note 2. Input as UTC

@@ -296,3 +296,3 @@ This function usually assumes the `dateString` is a local date-time. Set to true the `utc` option (the 3rd parameter) if it is a UTC date-time.

#### NOTE 3. Default Date Time
#### Note 3. Default Date Time

@@ -306,3 +306,3 @@ Default date is `January 1, 1970`, time is `00:00:00.000`. Values not passed will be complemented with them:

#### NOTE 4. Max Date / Min Date
#### Note 4. Max Date / Min Date

@@ -319,3 +319,3 @@ Parsable maximum date is `December 31, 9999`, minimum date is `January 1, 0001`.

#### NOTE 5. 12-hour notation and Meridiem
#### Note 5. 12-hour notation and Meridiem

@@ -329,3 +329,3 @@ If use `hh` or `h` (12-hour) token, use together `A` (meridiem) token to get the right value.

#### NOTE 6. Token disablement
#### Note 6. Token disablement

@@ -339,5 +339,5 @@ Use square brackets `[]` if a date-time string includes some token characters. Tokens inside square brackets in the `formatString` will be interpreted as normal characters:

#### NOTE 7. Wildcard
#### Note 7. Wildcard
A white space works as a wildcard token. This token is not interpret into anything. This means it can be ignored a specific variable string. For example, when you would like to ignore a time part from a date string, you can write as follows:
A white space works as a wildcard token. This token is not interpreted into anything. This means it can be ignored a specific variable string. For example, when you would like to ignore a time part from a date string, you can write as follows:

@@ -351,5 +351,5 @@ ```javascript

#### NOTE 8. Ellipsis
#### Note 8. Ellipsis
The parser supports `...` (ellipse) token. The above example can be also written like this:
The parser supports `...` (ellipsis) token. The above example can be also written like this:

@@ -356,0 +356,0 @@ ```javascript

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc