
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
angular-date-time-input
Advanced tools
This angular directive allows users to manually enter date-time values in a variety of formats but displays the date value in the specified format.
================================
Native AngularJS directive that allows user input of a date/time value. Valid dates are displayed in specified format, but input may be in any supported format.
#Dependencies
Requires:
#Testing We use karma and linting tools to ensure the quality of the code. The easiest way to run these checks is to use grunt:
npm install
npm test
The karma task will try to open Chrome as a browser in which to run the tests. Make sure this is available or change the configuration in test\test.config.js
#Usage
This project does not directly support bower. If you are using wiredep, you can dd the following to your bower.json file to allow wiredep to use this directive.
"overrides": {
"angular-date-time-input": {
"main": [
"src/dateTimeInput.js",
],
"dependencies": {
"angular": "^1.x",
"moment": "^2.x"
}
}
}
We use npm for dependency management. Add the following to your package
npm install angular-date-time-input --save
This will copy the angular-date-time-input files into your node_modules folder, along with its dependencies.
Load the script files in your application:
<script type="text/javascript" src="node_modules/moment/moment.js"></script>
<script type="text/javascript" src="node_modules/angular/angular.js"></script>
<script type="text/javascript" src="node_modules/angular-date-time-input/src/js/dateTimeInput.js"></script>
Add this module as a dependency to your application module:
var myAppModule = angular.module('MyApp', ['ui.dateTimeInput'])
Apply the directive to your form elements:
<input data-date-time-input="YYYY-MMM-DD" />
The value of the date-time-input attribute is the format the date values will be displayed.
Nota bene: The value saved in the model is, by default, a JavaScript Date object, not a string.
This can result in differences between what is seen in the model and what is displayed.
This option controls the way the date is displayed in the view, not the model.
<input data-date-time-input="YYYY-MMM-DD" />
See MomentJS documentation for valid formats.
This option defines additional input formats that will be accepted.
<input ... data-date-formats="['YYYY-MMM-DD']" />
Nota bene: Parsing multiple formats is considerably slower than parsing a single format. If you can avoid it, it is much faster to parse a single format.
See [MomentJS documentation] (http://momentjs.com/docs/#/parsing/string-formats) for more information.
This option enables/disables strict parsing of the input formats.
<input ... data-date-parse-strict="false" />
<input ... data-model-type="Date | moment | milliseconds | [custom format]" />
Default: 'Date'
Specifies the data type to use when storing the selected date in the model.
Accepts any string value, but the following values have special meaning (these values are case sensitive) :
'Date' stores a Date instance in the model. Will accept Date, moment, milliseconds, and ISO 8601 strings as initial input from the model'moment' stores a moment instance in the model. Accepts the same initial values as Date'milliseconds' store the epoch milliseconds (since 1-1-1970) in the model. Accepts the same initial values as DateAny other value is considered a custom format string.
##Contributing
See [Contributing] (contributing.md) document
angular-date-time-input is released under the MIT license and is copyright 2016 Knight Rider Consulting, Inc.. Boiled down to smaller chunks, it can be described with the following conditions.
The full angular-date-time-input license is located in the project repository for more information.
Support this project and other work by Dale Lotts via gittip.
FAQs
This angular directive allows users to manually enter date-time values in a variety of formats but displays the date value in the specified format.
The npm package angular-date-time-input receives a total of 566 weekly downloads. As such, angular-date-time-input popularity was classified as not popular.
We found that angular-date-time-input 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.