-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5474904
Showing
1,151 changed files
with
189,451 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["env"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es6": true, | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"valid-jsdoc": ["error", { | ||
"requireReturn": false, | ||
"requireReturnType": true, | ||
"requireParamDescription": true, | ||
"requireReturnDescription": true | ||
}], | ||
"require-jsdoc": ["error", { | ||
"require": { | ||
"FunctionDeclaration": true, | ||
"MethodDefinition": true, | ||
"ClassDeclaration": true | ||
} | ||
}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/dist export-ignore | ||
/node_modules export-ignore | ||
/src/spec.js export-ignore | ||
/thirdparty export-ignore | ||
.babelrc.json export-ignore | ||
.eslintrc export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
.npmignore export-ignore | ||
.prettierrc export-ignore | ||
index.html export-ignore | ||
LICENCE export-ignore | ||
webpack.config.js export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/dist | ||
/node_modules | ||
/src/spec.js | ||
/thirdparty | ||
.babelrc.json | ||
.eslintrc | ||
.gitattributes | ||
.gitignore | ||
.npmignore | ||
.prettierrc | ||
index.html | ||
LICENCE | ||
webpack.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"bracketSpacing": true, | ||
"semi": true, | ||
"singleQuote": false, | ||
"trailingComma": none | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 Antony Thorpe | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Date Input Field Reader for jQuery UI Datepicker | ||
Sneaky shortcuts for date input field data entry with jQuery UI datepicker in any locale. Provides a better UX by allowing the user to select either the input field or the datepicker. | ||
|
||
## Usage | ||
The user can enter: | ||
* `23` | ||
* `23/1` | ||
* `23 1` | ||
* `23-1` | ||
* `23.1` | ||
* `23 Jan` | ||
* or `23/1/18`(short year length) | ||
to generate `Wed Jan 03 2018 00:00:00 GMT+1300 (NZDT)` date string. | ||
|
||
If you are from a funny country that places the month first then this will work too: | ||
* `1/23` | ||
* `1 23` | ||
* `1-23` | ||
* `1.23` | ||
* `Jan 23` | ||
|
||
Also with year-first regions like Korea. | ||
* `18 Jan 23` | ||
|
||
## Installation | ||
```javascript | ||
npm install dateinputfieldreader | ||
``` | ||
|
||
## How to use | ||
* ensure that jQuery UI Datepicker is loaded first | ||
* import the function: | ||
```javascript | ||
import extractDateFromInput from "dateinputfieldreader"; | ||
``` | ||
and within the change event of the datepicker run the data entry through this function. Below is some `knockoutjs` code you can modify: | ||
```javascript | ||
//handle the field changing update observable and excluded dates for beforeShowDay | ||
ko.utils.registerEventHandler(element, "change", function(event) { | ||
var enteredDate = (event.target.value).trim(); | ||
var extractedDate = extractDateFromInput(enteredDate); | ||
|
||
if (extractedDate){ | ||
// next update the variable | ||
observable(extractedDate); | ||
|
||
// and update the datepicker | ||
$(element).datepicker("setDate", extractedDate); | ||
} | ||
}); | ||
``` | ||
|
||
## Requirements | ||
* [jQuery UI Datepicker](https://jqueryui.com/datepicker/) | ||
|
||
## Tests | ||
Run online [here](http://antonythorpe.github.io/dateInputFieldReader/index.html). | ||
Locally `npm test` to launch in Chrome. | ||
|
||
## Contributions | ||
Pull requests are most welcome! | ||
|
||
## Support | ||
None sorry. | ||
|
||
## Change Log | ||
[File](changelog.md) | ||
|
||
## Licence | ||
[MIT](LICENCE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Changelog of Date Input Field Reader | ||
|
||
#### 1.0.0 | ||
* Initial commit |
Oops, something went wrong.