automatic project update
This commit is contained in:
parent
03ac969355
commit
b55fdd91d3
@ -24,7 +24,7 @@
|
||||
"en"
|
||||
],
|
||||
"serverPort": 8080,
|
||||
"jhipsterVersion": "3.4.0",
|
||||
"jhipsterVersion": "3.4.1",
|
||||
"enableSocialSignIn": false,
|
||||
"useSass": false,
|
||||
"jhiPrefix": "jhi"
|
||||
|
@ -21,7 +21,7 @@
|
||||
"angular-translate-storage-cookie": "2.11.0",
|
||||
"angular-ui-router": "0.3.0",
|
||||
"bootstrap": "3.3.6",
|
||||
"bootstrap-ui-datetime-picker": "2.3.1",
|
||||
"bootstrap-ui-datetime-picker": "2.4.0",
|
||||
"jquery": "2.2.4",
|
||||
"json3": "3.3.2",
|
||||
"messageformat": "0.3.1",
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Generated on 2016-05-27 using generator-jhipster 3.4.0
|
||||
// Generated on 2016-06-13 using generator-jhipster 3.4.1
|
||||
'use strict';
|
||||
|
||||
var gulp = require('gulp'),
|
||||
|
32
package.json
32
package.json
@ -9,12 +9,12 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"bower": "1.7.9",
|
||||
"browser-sync": "2.12.5",
|
||||
"browser-sync": "2.12.10",
|
||||
"del": "2.2.0",
|
||||
"eslint-config-angular": "0.5.0",
|
||||
"eslint-plugin-angular": "1.0.1",
|
||||
"event-stream": "3.3.2",
|
||||
"generator-jhipster": "3.4.0",
|
||||
"generator-jhipster": "3.4.1",
|
||||
"gulp": "3.9.1",
|
||||
"gulp-angular-filesort": "1.1.1",
|
||||
"gulp-angular-templatecache": "1.8.0",
|
||||
@ -24,17 +24,17 @@
|
||||
"gulp-eslint": "2.0.0",
|
||||
"gulp-flatten": "0.2.0",
|
||||
"gulp-footer": "1.0.5",
|
||||
"gulp-htmlmin": "1.3.0",
|
||||
"gulp-if": "2.0.0",
|
||||
"gulp-imagemin": "2.4.0",
|
||||
"gulp-inject": "4.0.0",
|
||||
"gulp-htmlmin": "2.0.0",
|
||||
"gulp-if": "2.0.1",
|
||||
"gulp-imagemin": "3.0.1",
|
||||
"gulp-inject": "4.1.0",
|
||||
"gulp-natural-sort": "0.1.1",
|
||||
"gulp-ng-annotate": "2.0.0",
|
||||
"gulp-rename": "1.2.2",
|
||||
"gulp-ng-constant": "1.1.0",
|
||||
"gulp-notify": "2.2.0",
|
||||
"gulp-plumber": "1.1.0",
|
||||
"gulp-protractor": "2.3.0",
|
||||
"gulp-protractor": "2.4.0",
|
||||
"gulp-util": "3.0.7",
|
||||
"gulp-rev": "7.0.0",
|
||||
"gulp-rev-replace": "0.4.3",
|
||||
@ -44,23 +44,23 @@
|
||||
"jasmine-core": "2.4.1",
|
||||
"jasmine-reporters": "2.1.1",
|
||||
"karma": "0.13.22",
|
||||
"karma-chrome-launcher": "0.2.3",
|
||||
"karma-coverage": "0.5.5",
|
||||
"karma-jasmine": "0.3.8",
|
||||
"karma-jenkins-reporter": "0.0.2",
|
||||
"karma-chrome-launcher": "1.0.1",
|
||||
"karma-coverage": "1.0.0",
|
||||
"karma-jasmine": "1.0.2",
|
||||
"karma-junit-reporter": "1.0.0",
|
||||
"karma-phantomjs-launcher": "1.0.0",
|
||||
"karma-script-launcher": "0.2.0",
|
||||
"karma-script-launcher": "1.0.0",
|
||||
"lazypipe": "1.0.1",
|
||||
"lodash": "4.11.1",
|
||||
"main-bower-files": "2.11.1",
|
||||
"lodash": "4.13.1",
|
||||
"main-bower-files": "2.13.1",
|
||||
"map-stream": "0.0.6",
|
||||
"phantomjs-prebuilt": "2.1.7",
|
||||
"protractor": "3.3.0",
|
||||
"protractor-jasmine2-screenshot-reporter": "0.3.1",
|
||||
"proxy-middleware": "0.15.0",
|
||||
"run-sequence": "1.1.5",
|
||||
"run-sequence": "1.2.1",
|
||||
"xml2js": "0.4.16",
|
||||
"yargs": "4.6.0"
|
||||
"yargs": "4.7.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^4.3"
|
||||
|
17
pom.xml
17
pom.xml
@ -39,6 +39,7 @@
|
||||
<mapstruct.version>1.0.0.Final</mapstruct.version>
|
||||
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
|
||||
<maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
|
||||
<maven-resources-plugin.version>3.0.0</maven-resources-plugin.version>
|
||||
<sortpom-maven-plugin.version>2.5.0</sortpom-maven-plugin.version>
|
||||
<metrics-spark-reporter.version>1.2</metrics-spark-reporter.version>
|
||||
<metrics-spring.version>3.1.3</metrics-spring.version>
|
||||
@ -448,18 +449,19 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>${maven-resources-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>resources</goal>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>target/classes</outputDirectory>
|
||||
<useDefaultDelimiters>false</useDefaultDelimiters>
|
||||
<delimiters>
|
||||
<delimiter>#</delimiter>
|
||||
<delimiter>#</delimiter>
|
||||
</delimiters>
|
||||
<resources>
|
||||
<resource>
|
||||
@ -831,15 +833,4 @@
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||
<version>2.19</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
</project>
|
||||
|
@ -5,6 +5,7 @@ import io.github.jhipster.sample.domain.User;
|
||||
import io.github.jhipster.sample.repository.AuthorityRepository;
|
||||
import io.github.jhipster.sample.repository.PersistentTokenRepository;
|
||||
import io.github.jhipster.sample.repository.UserRepository;
|
||||
import io.github.jhipster.sample.security.AuthoritiesConstants;
|
||||
import io.github.jhipster.sample.security.SecurityUtils;
|
||||
import io.github.jhipster.sample.service.util.RandomUtil;
|
||||
import io.github.jhipster.sample.web.rest.dto.ManagedUserDTO;
|
||||
@ -89,7 +90,7 @@ public class UserService {
|
||||
String langKey) {
|
||||
|
||||
User newUser = new User();
|
||||
Authority authority = authorityRepository.findOne("ROLE_USER");
|
||||
Authority authority = authorityRepository.findOne(AuthoritiesConstants.USER);
|
||||
Set<Authority> authorities = new HashSet<>();
|
||||
String encryptedPassword = passwordEncoder.encode(password);
|
||||
newUser.setLogin(login);
|
||||
|
@ -1,17 +1,18 @@
|
||||
package io.github.jhipster.sample.web.rest;
|
||||
|
||||
import io.github.jhipster.sample.config.JHipsterProperties;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import io.github.jhipster.sample.config.JHipsterProperties;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
public class ProfileInfoResource {
|
||||
@ -22,7 +23,9 @@ public class ProfileInfoResource {
|
||||
@Inject
|
||||
private JHipsterProperties jHipsterProperties;
|
||||
|
||||
@RequestMapping("/profile-info")
|
||||
@RequestMapping(value = "/profile-info",
|
||||
method = RequestMethod.GET,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ProfileInfoResponse getActiveProfiles() {
|
||||
return new ProfileInfoResponse(env.getActiveProfiles(), getRibbonEnv());
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class ExceptionTranslator {
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
@ResponseStatus(HttpStatus.FORBIDDEN)
|
||||
@ResponseBody
|
||||
public ErrorDTO processAccessDeniedExcpetion(AccessDeniedException e) {
|
||||
public ErrorDTO processAccessDeniedException(AccessDeniedException e) {
|
||||
return new ErrorDTO(ErrorConstants.ERR_ACCESS_DENIED, e.getMessage());
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@
|
||||
var GOOG_FIXURL_LANG = '[[${#locale.language}]]', GOOG_FIXURL_SITE = location.host;
|
||||
/*]]>*/
|
||||
</script>
|
||||
<script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
|
||||
<script src="https://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -5,9 +5,10 @@
|
||||
.module('jhipsterSampleApplicationApp')
|
||||
.config(localStorageConfig);
|
||||
|
||||
localStorageConfig.$inject = ['$localStorageProvider'];
|
||||
localStorageConfig.$inject = ['$localStorageProvider', '$sessionStorageProvider'];
|
||||
|
||||
function localStorageConfig($localStorageProvider) {
|
||||
function localStorageConfig($localStorageProvider, $sessionStorageProvider) {
|
||||
$localStorageProvider.setKeyPrefix('jhi-');
|
||||
$sessionStorageProvider.setKeyPrefix('jhi-');
|
||||
}
|
||||
})();
|
||||
|
@ -3,13 +3,14 @@
|
||||
|
||||
var jhiItemCount = {
|
||||
template: '<div class="info">' +
|
||||
'Showing {{(($ctrl.page-1) * 20)==0 ? 1:(($ctrl.page-1) * 20 + 1)}} - ' +
|
||||
'{{($ctrl.page * 20) < $ctrl.queryCount ? ($ctrl.page * 20) : $ctrl.queryCount}} ' +
|
||||
'Showing {{(($ctrl.page - 1) * $ctrl.itemsPerPage) == 0 ? 1 : (($ctrl.page - 1) * $ctrl.itemsPerPage + 1)}} - ' +
|
||||
'{{($ctrl.page * $ctrl.itemsPerPage) < $ctrl.queryCount ? ($ctrl.page * $ctrl.itemsPerPage) : $ctrl.queryCount}} ' +
|
||||
'of {{$ctrl.queryCount}} items.' +
|
||||
'</div>',
|
||||
bindings: {
|
||||
page: '<',
|
||||
queryCount: '<total'
|
||||
queryCount: '<total',
|
||||
itemsPerPage: '<'
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
return service;
|
||||
|
||||
function parse (header) {
|
||||
function parse(header) {
|
||||
if (header.length === 0) {
|
||||
throw new Error('input must not be of zero length');
|
||||
}
|
||||
@ -22,7 +22,7 @@
|
||||
var parts = header.split(',');
|
||||
var links = {};
|
||||
// Parse each part into a named link
|
||||
angular.forEach(parts, function (p) {
|
||||
angular.forEach(parts, function(p) {
|
||||
var section = p.split(';');
|
||||
if (section.length !== 2) {
|
||||
throw new Error('section could not be split on ";"');
|
||||
@ -34,13 +34,12 @@
|
||||
function($0, $1, $2, $3) { queryString[$1] = $3; }
|
||||
);
|
||||
var page = queryString.page;
|
||||
if( angular.isString(page) ) {
|
||||
if (angular.isString(page)) {
|
||||
page = parseInt(page);
|
||||
}
|
||||
var name = section[1].replace(/rel="(.*)"/, '$1').trim();
|
||||
links[name] = page;
|
||||
});
|
||||
|
||||
return links;
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,9 @@
|
||||
vm.operations = [];
|
||||
vm.loadPage = loadPage;
|
||||
vm.page = 0;
|
||||
vm.links = {
|
||||
last: 0
|
||||
};
|
||||
vm.predicate = 'id';
|
||||
vm.reset = reset;
|
||||
vm.reverse = true;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bootstrap-ui-datetime-picker",
|
||||
"version": "2.3.1",
|
||||
"version": "2.4.0",
|
||||
"homepage": "https://github.com/Gillardo/bootstrap-ui-datetime-picker",
|
||||
"authors": [
|
||||
"Gillardo <darren.gillard81@gmail.com>"
|
||||
@ -29,15 +29,15 @@
|
||||
"tests"
|
||||
],
|
||||
"dependencies": {
|
||||
"angular-bootstrap": "~1.2.0"
|
||||
"angular-bootstrap": "^1.2.0"
|
||||
},
|
||||
"_release": "2.3.1",
|
||||
"_release": "2.4.0",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "2.3.1",
|
||||
"commit": "865d67644cd408d7a4b678b92c80d525327b3478"
|
||||
"tag": "2.4.0",
|
||||
"commit": "6bf5c38a6867aaa261051280695e15a5be887fff"
|
||||
},
|
||||
"_source": "https://github.com/gillardo/bootstrap-ui-datetime-picker.git",
|
||||
"_target": "2.3.1",
|
||||
"_target": "2.4.0",
|
||||
"_originalSource": "bootstrap-ui-datetime-picker"
|
||||
}
|
@ -26,6 +26,7 @@ You have the following properties available to use with the directive. All are
|
||||
* ngModel (required) - Your date object
|
||||
* isOpen - (true/false)
|
||||
* closeOnDateSelection (true/false)
|
||||
* closeOnTimeNow (true/false)
|
||||
* enableDate (true/false)
|
||||
* enableTime (true/false)
|
||||
* buttonBar (object)
|
||||
@ -34,11 +35,15 @@ You have the following properties available to use with the directive. All are
|
||||
* datepickerOptions (object)
|
||||
* timepickerOptions (object)
|
||||
* defaultTime (string)
|
||||
* saveAs (boolean|function|'ISO'|'json'|'number')
|
||||
* readAs (boolean|function)
|
||||
|
||||
##### isOpen
|
||||
Whether the popup/dropdown is visible or not. Defaults to false
|
||||
##### closeOnDateSelection
|
||||
Close popup once a date has been chosen. TimePicker will stay open until user closes.
|
||||
##### closeOnTimeNow
|
||||
Close popup once a time has been chosen via now button.
|
||||
##### enableDate
|
||||
Whether you would like the user to be able to select a date. Defaults to true
|
||||
##### enableTime
|
||||
@ -51,13 +56,25 @@ The initial picker to open when the control is first pressed
|
||||
##### reOpenDefault
|
||||
The picker to set as the picker to open once the control has already been opened at least once. Setting to `false` will default to the date picker if both date and time are enabled, or just the enabled control if only time or date is in use.
|
||||
##### datepickerOptions
|
||||
Object to configure settings for the datepicker (can be found on angularUI site)
|
||||
Object to configure settings for the datepicker (can be found on [angularUI site](https://angular-ui.github.io/bootstrap/#/datepicker))
|
||||
##### timepickerOptions
|
||||
Object to configure settings for the timepicker (can be found on angularUI site)
|
||||
Object to configure settings for the timepicker (can be found on [angularUI site](https://angular-ui.github.io/bootstrap/#/timepicker))
|
||||
##### defaultTime
|
||||
Initial time when a new date is selected (e.g. "14:00:00" or "2:00 pm")
|
||||
##### whenClosed
|
||||
An callback function to call when the picker dropdown is closed. See demo for more details.
|
||||
##### saveAs
|
||||
A boolean value to switch saving the Date to the model as a string, or a ngModel.$parsers function to take over the transformation from the Date object to a string.
|
||||
Possible values:
|
||||
* true
|
||||
* false
|
||||
* 'ISO' (Date.toISOString())
|
||||
* 'json' (Date.toJSON())
|
||||
* 'number' (Date.valueOf())
|
||||
* a function accepting a value parameter and returning the converted value to save to the model.
|
||||
Note: If using an html5 input type, the default parser will use Date.toLocaleString() to convert to a string. To override this, provide a function with your desired formatted conversion. Otherwise all other input types will use the supplied date format.
|
||||
##### readAs
|
||||
A boolean value to convert a string (or Date.valueOf()) value back to a Date object from the ngModel, or a ngModel.$formatters function to take over the transformation completely.
|
||||
|
||||
## uiDatetimePickerConfig
|
||||
Now datetimePicker options are globally set by default. If you do not state the values within the declaration, the config options are used instead. Here are the default options
|
||||
@ -103,9 +120,12 @@ Now datetimePicker options are globally set by default. If you do not state the
|
||||
}
|
||||
},
|
||||
closeOnDateSelection: true,
|
||||
closeOnTimeNow: true,
|
||||
appendToBody: false,
|
||||
altInputFormats: [],
|
||||
ngModelOptions: { }
|
||||
ngModelOptions: { },
|
||||
saveAs: false,
|
||||
readAs: false,
|
||||
})
|
||||
```
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bootstrap-ui-datetime-picker",
|
||||
"version": "2.3.1",
|
||||
"version": "2.4.0",
|
||||
"homepage": "https://github.com/Gillardo/bootstrap-ui-datetime-picker",
|
||||
"authors": [
|
||||
"Gillardo <darren.gillard81@gmail.com>"
|
||||
@ -29,6 +29,6 @@
|
||||
"tests"
|
||||
],
|
||||
"dependencies": {
|
||||
"angular-bootstrap": "~1.2.0"
|
||||
"angular-bootstrap": "^1.2.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// https://github.com/Gillardo/bootstrap-ui-datetime-picker
|
||||
// Version: 2.3.1
|
||||
// Released: 2016-04-07
|
||||
// Version: 2.4.0
|
||||
// Released: 2016-06-03
|
||||
angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.position'])
|
||||
.constant('uiDatetimePickerConfig', {
|
||||
dateFormat: 'yyyy-MM-dd HH:mm',
|
||||
@ -42,17 +42,23 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
|
||||
}
|
||||
},
|
||||
closeOnDateSelection: true,
|
||||
closeOnTimeNow: true,
|
||||
appendToBody: false,
|
||||
altInputFormats: [],
|
||||
ngModelOptions: { }
|
||||
ngModelOptions: { },
|
||||
saveAs: false,
|
||||
readAs: false,
|
||||
})
|
||||
.controller('DateTimePickerController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$document', '$timeout', '$uibPosition', 'dateFilter', 'uibDateParser', 'uiDatetimePickerConfig', '$rootScope',
|
||||
function ($scope, $element, $attrs, $compile, $parse, $document, $timeout, $uibPosition, dateFilter, uibDateParser, uiDatetimePickerConfig, $rootScope) {
|
||||
var dateFormat = uiDatetimePickerConfig.dateFormat,
|
||||
ngModel, ngModelOptions, $popup, cache = {}, watchListeners = [],
|
||||
closeOnDateSelection = angular.isDefined($attrs.closeOnDateSelection) ? $scope.$parent.$eval($attrs.closeOnDateSelection) : uiDatetimePickerConfig.closeOnDateSelection,
|
||||
closeOnTimeNow = angular.isDefined($attrs.closeOnTimeNow) ? $scope.$parent.$eval($attrs.closeOnTimeNow) : uiDatetimePickerConfig.closeOnTimeNow,
|
||||
appendToBody = angular.isDefined($attrs.datepickerAppendToBody) ? $scope.$parent.$eval($attrs.datepickerAppendToBody) : uiDatetimePickerConfig.appendToBody,
|
||||
altInputFormats = angular.isDefined($attrs.altInputFormats) ? $scope.$parent.$eval($attrs.altInputFormats) : uiDatetimePickerConfig.altInputFormats;
|
||||
altInputFormats = angular.isDefined($attrs.altInputFormats) ? $scope.$parent.$eval($attrs.altInputFormats) : uiDatetimePickerConfig.altInputFormats,
|
||||
saveAs = angular.isDefined($attrs.saveAs) ? $scope.$parent.$eval($attrs.saveAs) || $attrs.saveAs : uiDatetimePickerConfig.saveAs,
|
||||
readAs = angular.isDefined($attrs.readAs) ? $scope.$parent.$eval($attrs.readAs) : uiDatetimePickerConfig.readAs;
|
||||
|
||||
this.init = function(_ngModel) {
|
||||
ngModel = _ngModel;
|
||||
@ -203,6 +209,20 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
|
||||
});
|
||||
}
|
||||
|
||||
if (saveAs) {
|
||||
// If it is determined closure var's need to be exposed to the parser, don't add the formatter here.
|
||||
// Instead just call the method from within the stock parser with this context and/or any needed closure variables.
|
||||
if (angular.isFunction(saveAs))
|
||||
ngModel.$parsers.push(saveAs);
|
||||
else
|
||||
ngModel.$parsers.push(saveAsParser);
|
||||
|
||||
// Assuming if saveAs is !false, we'll want to convert, either pass the function, or the stock str/num -> Date obj formatter.
|
||||
if (angular.isFunction(readAs))
|
||||
ngModel.$formatters.push(readAs);
|
||||
else
|
||||
ngModel.$formatters.push(readAsFormatter);
|
||||
}
|
||||
// Detect changes in the view from the text box
|
||||
ngModel.$viewChangeListeners.push(function() {
|
||||
$scope.date = parseDateString(ngModel.$viewValue);
|
||||
@ -220,6 +240,38 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
|
||||
$element.after($popup);
|
||||
}
|
||||
|
||||
function readAsFormatter(value) {
|
||||
if (ngModel.$isEmpty(value))
|
||||
return value;
|
||||
|
||||
var d = new Date(value);
|
||||
if (angular.isDate(d) && !isNaN(d))
|
||||
return d;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
function saveAsParser(value) {
|
||||
if (!value || angular.isString(value) || !angular.isDate(value) || isNaN(value))
|
||||
return value;
|
||||
|
||||
if (saveAs === 'ISO')
|
||||
return value.toISOString();
|
||||
|
||||
if (saveAs === 'json')
|
||||
return value.toJSON();
|
||||
|
||||
if (saveAs === 'number')
|
||||
return value.valueOf();
|
||||
|
||||
if (!isHtml5DateInput) {
|
||||
dateFormat = dateFormat.replace(/M!/, 'MM')
|
||||
.replace(/d!/, 'dd');
|
||||
return uibDateParser.filter(uibDateParser.fromTimezone(value, ngModelOptions.timezone), dateFormat);
|
||||
} else {
|
||||
return uibDateParser.fromTimezone(value, ngModelOptions.timezone).toLocaleString();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// get text
|
||||
@ -236,7 +288,7 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
|
||||
};
|
||||
|
||||
// Inner change
|
||||
$scope.dateSelection = function (dt) {
|
||||
$scope.dateSelection = function (dt, opt) {
|
||||
|
||||
// check if timePicker is being shown and merge dates, so that the date
|
||||
// part is never changed, only the time
|
||||
@ -291,18 +343,13 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
|
||||
} else {
|
||||
$scope.close(false);
|
||||
}
|
||||
} else if (closeOnTimeNow && $scope.showPicker === 'time' && date != null && opt === 'now') {
|
||||
$scope.close(false);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$scope.keydown = function(evt) {
|
||||
if (evt.which === 27) {
|
||||
$scope.close(false);
|
||||
$element[0].focus();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch('isOpen', function (value) {
|
||||
$scope.dropdownStyle = {
|
||||
display: value ? 'block' : 'none'
|
||||
@ -372,7 +419,7 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
|
||||
}
|
||||
}
|
||||
|
||||
$scope.dateSelection(date);
|
||||
$scope.dateSelection(date, opt);
|
||||
};
|
||||
|
||||
$scope.open = function (picker, evt) {
|
||||
@ -404,10 +451,11 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
|
||||
|
||||
// if a on-close-fn has been defined, lets call it
|
||||
// we only call this if closePressed is defined!
|
||||
if (angular.isDefined(closePressed))
|
||||
if (angular.isDefined(closePressed)) {
|
||||
$scope.whenClosed({ args: { closePressed: closePressed, openDate: cache['openDate'] || null, closeDate: $scope.date } });
|
||||
|
||||
$element[0].focus();
|
||||
} else {
|
||||
$element[0].focus();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$on('$destroy', function () {
|
||||
@ -580,12 +628,12 @@ angular.module('ui.bootstrap.datetimepicker').run(['$templateCache', function($t
|
||||
'use strict';
|
||||
|
||||
$templateCache.put('template/date-picker.html',
|
||||
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'date'\" ng-style=dropdownStyle style=left:inherit ng-keydown=keydown($event) ng-click=$event.stopPropagation()><li style=\"padding:0 5px 5px 5px\" class=date-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('today') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('today')\" ng-click=\"select('today')\" ng-disabled=\"isDisabled('today')\">{{ getText('today') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear')\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('time') && enableTime) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('time') && enableTime\" ng-click=\"open('time', $event)\">{{ getText('time')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=close(true)>{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
|
||||
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'date'\" ng-style=dropdownStyle style=left:inherit ng-click=$event.stopPropagation()><li style=\"padding:0 5px 5px 5px\" class=date-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('today') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('today')\" ng-click=\"select('today')\" ng-disabled=\"isDisabled('today')\">{{ getText('today') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear')\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('time') && enableTime) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('time') && enableTime\" ng-click=\"open('time', $event)\">{{ getText('time')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=close(true)>{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
|
||||
);
|
||||
|
||||
|
||||
$templateCache.put('template/time-picker.html',
|
||||
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'time'\" ng-style=dropdownStyle style=left:inherit ng-keydown=keydown($event) ng-click=$event.stopPropagation()><li style=\"padding:0 5px 5px 5px\" class=time-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('now') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('now')\" ng-click=\"select('now')\" ng-disabled=\"isDisabled('now')\">{{ getText('now') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear')\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('date') && enableDate) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('date') && enableDate\" ng-click=\"open('date', $event)\">{{ getText('date')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=close(true)>{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
|
||||
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'time'\" ng-style=dropdownStyle style=left:inherit ng-click=$event.stopPropagation()><li style=\"padding:0 5px 5px 5px\" class=time-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('now') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('now')\" ng-click=\"select('now')\" ng-disabled=\"isDisabled('now')\">{{ getText('now') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear')\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('date') && enableDate) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('date') && enableDate\" ng-click=\"open('date', $event)\">{{ getText('date')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=close(true)>{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
|
||||
);
|
||||
|
||||
}]);
|
||||
|
File diff suppressed because one or more lines are too long
@ -2,12 +2,12 @@ angular.module('ui.bootstrap.datetimepicker').run(['$templateCache', function($t
|
||||
'use strict';
|
||||
|
||||
$templateCache.put('template/date-picker.html',
|
||||
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'date'\" ng-style=dropdownStyle style=left:inherit ng-keydown=keydown($event) ng-click=$event.stopPropagation()><li style=\"padding:0 5px 5px 5px\" class=date-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('today') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('today')\" ng-click=\"select('today')\" ng-disabled=\"isDisabled('today')\">{{ getText('today') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear')\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('time') && enableTime) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('time') && enableTime\" ng-click=\"open('time', $event)\">{{ getText('time')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=close(true)>{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
|
||||
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'date'\" ng-style=dropdownStyle style=left:inherit ng-click=$event.stopPropagation()><li style=\"padding:0 5px 5px 5px\" class=date-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('today') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('today')\" ng-click=\"select('today')\" ng-disabled=\"isDisabled('today')\">{{ getText('today') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear')\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('time') && enableTime) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('time') && enableTime\" ng-click=\"open('time', $event)\">{{ getText('time')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=close(true)>{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
|
||||
);
|
||||
|
||||
|
||||
$templateCache.put('template/time-picker.html',
|
||||
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'time'\" ng-style=dropdownStyle style=left:inherit ng-keydown=keydown($event) ng-click=$event.stopPropagation()><li style=\"padding:0 5px 5px 5px\" class=time-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('now') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('now')\" ng-click=\"select('now')\" ng-disabled=\"isDisabled('now')\">{{ getText('now') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear')\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('date') && enableDate) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('date') && enableDate\" ng-click=\"open('date', $event)\">{{ getText('date')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=close(true)>{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
|
||||
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'time'\" ng-style=dropdownStyle style=left:inherit ng-click=$event.stopPropagation()><li style=\"padding:0 5px 5px 5px\" class=time-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('now') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('now')\" ng-click=\"select('now')\" ng-disabled=\"isDisabled('now')\">{{ getText('now') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear')\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('date') && enableDate) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('date') && enableDate\" ng-click=\"open('date', $event)\">{{ getText('date')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=close(true)>{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
|
||||
);
|
||||
|
||||
}]);
|
||||
|
@ -5,7 +5,7 @@
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" />
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.2.4/ui-bootstrap-tpls.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.2.0/ui-bootstrap-tpls.js"></script>
|
||||
<script src="datetime-picker.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</head>
|
||||
@ -19,7 +19,6 @@
|
||||
<li>dateDisabled used, todays date is disabled when the picker is displaying days</li>
|
||||
<li>closeOnDateSelection="false"</li>
|
||||
<li>datepickerOptions - showWeeks=false, startingDay=1</li>
|
||||
<li>clear-text - is set to 'Remove' instead of using the default 'Clear'</li>
|
||||
</ul>
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
@ -238,9 +237,9 @@
|
||||
<div class="col-sm-10">
|
||||
<p class="input-group">
|
||||
<input type="text" class="form-control" datetime-picker="mediumDate" ng-model="ctrl.picker12.date" is-open="ctrl.picker12.open" enable-time="false" button-bar="ctrl.picker12.buttonBar" />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" ng-click="ctrl.openCalendar($event, 'picker12')"><i class="fa fa-calendar"></i></button>
|
||||
</span>
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" ng-click="ctrl.openCalendar($event, 'picker12')"><i class="fa fa-calendar"></i></button>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -253,9 +252,9 @@
|
||||
<div class="col-sm-10">
|
||||
<p class="input-group">
|
||||
<input type="text" class="form-control" datetime-picker="dd/MM/yyyy HH:mm" ng-model="ctrl.picker13.date" is-open="ctrl.picker13.open" when-closed="ctrl.picker13.closed(args)" />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" ng-click="ctrl.openCalendar($event, 'picker13')"><i class="fa fa-calendar"></i></button>
|
||||
</span>
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" ng-click="ctrl.openCalendar($event, 'picker13')"><i class="fa fa-calendar"></i></button>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -266,6 +265,28 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr />
|
||||
<h3>Save As ISO</h3>
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">ISO</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="input-group">
|
||||
<input type="text" class="form-control" datetime-picker="dd/MM/yyyy" enable-time="false" ng-model="ctrl.picker14.date" is-open="ctrl.picker14.open" save-as="ISO" />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" ng-click="ctrl.openCalendar($event, 'picker14')"><i class="fa fa-calendar"></i></button>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">On Close</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">{{ ctrl.picker14.date }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr />
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
@ -130,6 +130,11 @@ app.controller('MyController', ['$scope', function($scope) {
|
||||
}
|
||||
};
|
||||
|
||||
// saveAs - ISO
|
||||
this.picker14 = {
|
||||
date: new Date().toISOString()
|
||||
}
|
||||
|
||||
this.openCalendar = function(e, picker) {
|
||||
that[picker].open = true;
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Karma configuration
|
||||
// http://karma-runner.github.io/0.10/config/configuration-file.html
|
||||
// http://karma-runner.github.io/0.13/config/configuration-file.html
|
||||
|
||||
var sourcePreprocessors = ['coverage'];
|
||||
|
||||
@ -63,15 +63,13 @@ module.exports = function (config) {
|
||||
'./**/*.js': sourcePreprocessors
|
||||
},
|
||||
|
||||
reporters: ['dots', 'jenkins', 'coverage', 'progress'],
|
||||
reporters: ['dots', 'junit', 'coverage', 'progress'],
|
||||
|
||||
jenkinsReporter: {
|
||||
|
||||
junitReporter: {
|
||||
outputFile: 'target/test-results/karma/TESTS-results.xml'
|
||||
},
|
||||
|
||||
coverageReporter: {
|
||||
|
||||
dir: 'target/test-results/coverage',
|
||||
reporters: [
|
||||
{type: 'lcov', subdir: 'report-lcov'}
|
||||
|
Loading…
Reference in New Issue
Block a user