Skip to content

Commit 4f5fc18

Browse files
authored
feat(datepicker): added custom date parse logic for manual date input (#3271)
fixes #3206 fixes #3104 fixes #2809
1 parent 321f9ae commit 4f5fc18

File tree

171 files changed

+20980
-2356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+20980
-2356
lines changed

.angular-cli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
],
7878
"test": {
7979
"karma": {
80-
"config": "karma.conf.js"
80+
"config": "karma-demo.conf.js"
8181
}
8282
},
8383
"defaults": {

karma-demo.conf.js

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/0.13/config/configuration-file.html
3+
4+
const customLaunchers = require('./scripts/sauce-browsers').customLaunchers;
5+
6+
module.exports = function (config) {
7+
const configuration = {
8+
basePath: '',
9+
frameworks: ['jasmine', '@angular/cli'],
10+
plugins: [
11+
require('karma-jasmine'),
12+
require('karma-chrome-launcher'),
13+
require('karma-firefox-launcher'),
14+
require('karma-jasmine-html-reporter'),
15+
require('karma-coverage-istanbul-reporter'),
16+
require('@angular/cli/plugins/karma'),
17+
require('karma-sauce-launcher')
18+
],
19+
files: [
20+
{pattern: './scripts/test.ts', watched: false}
21+
],
22+
preprocessors: {
23+
'./scripts/test.ts': ['@angular/cli']
24+
},
25+
coverageIstanbulReporter: {
26+
reports: ['html', 'lcovonly'],
27+
fixWebpackSourcePaths: true
28+
},
29+
angularCli: {
30+
environment: 'dev'
31+
},
32+
reporters: config.angularCli && config.angularCli.codeCoverage
33+
? ['dots', 'coverage-istanbul']
34+
: ['dots', 'kjhtml'],
35+
port: 9876,
36+
colors: true,
37+
logLevel: config.LOG_INFO,
38+
autoWatch: true,
39+
browsers: ['ChromeHeadless'],
40+
browserNoActivityTimeout: 20000,
41+
browserDisconnectTolerance: 2,
42+
browserDisconnectTimeout: 5000,
43+
singleRun: false,
44+
customLaunchers: {
45+
Chrome_travis_ci: {
46+
base: 'ChromeHeadless',
47+
flags: [
48+
'--headless',
49+
'--disable-gpu',
50+
'--no-sandbox',
51+
'--remote-debugging-port=9222'
52+
]
53+
}
54+
},
55+
mime: {'text/x-typescript': ['ts', 'tsx']},
56+
client: {captureConsole: true, clearContext: false}
57+
};
58+
59+
if (process.env.TRAVIS) {
60+
configuration.browsers = ['Chrome_travis_ci'];
61+
}
62+
63+
if (process.env.SAUCE) {
64+
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
65+
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');
66+
process.exit(1);
67+
}
68+
69+
configuration.plugins.push(require('karma-sauce-launcher'));
70+
Object.assign(configuration, {
71+
logLevel: config.LOG_INFO,
72+
reporters: ['dots', 'saucelabs'],
73+
singleRun: false,
74+
concurrency: 2,
75+
captureTimeout: 60000,
76+
sauceLabs: {
77+
testName: 'ngx-bootstrap',
78+
build: process.env.TRAVIS_JOB_NUMBER,
79+
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
80+
retryLimit: 5,
81+
startConnect: false,
82+
recordVideo: false,
83+
recordScreenshots: false,
84+
options: {
85+
'command-timeout': 600,
86+
'idle-timeout': 600,
87+
'max-duration': 5400
88+
}
89+
},
90+
customLaunchers: {
91+
'SL_CHROME': {
92+
base: 'SauceLabs',
93+
browserName: 'chrome',
94+
version: 'latest'
95+
},
96+
'SL_CHROME_1': {
97+
base: 'SauceLabs',
98+
browserName: 'chrome',
99+
version: 'latest-1'
100+
},
101+
'SL_FIREFOX': {
102+
base: 'SauceLabs',
103+
browserName: 'firefox',
104+
version: 'latest'
105+
},
106+
'SL_FIREFOX_1': {
107+
base: 'SauceLabs',
108+
browserName: 'firefox',
109+
version: 'latest-1'
110+
},
111+
'SL_IE10': {
112+
base: 'SauceLabs',
113+
browserName: 'internet explorer',
114+
// platform: 'Windows 2012',
115+
version: '10'
116+
},
117+
'SL_IE11': {
118+
base: 'SauceLabs',
119+
browserName: 'internet explorer',
120+
platform: 'Windows 8.1',
121+
version: '11.0'
122+
},
123+
'SL_EDGE13': {
124+
base: 'SauceLabs',
125+
browserName: 'MicrosoftEdge',
126+
platform: 'Windows 10',
127+
version: '13'
128+
},
129+
'SL_EDGE14': {
130+
base: 'SauceLabs',
131+
browserName: 'MicrosoftEdge',
132+
platform: 'Windows 10',
133+
version: '14'
134+
},
135+
'SL_EDGE15': {
136+
base: 'SauceLabs',
137+
browserName: 'MicrosoftEdge',
138+
platform: 'Windows 10',
139+
version: '15'
140+
},
141+
'SL_SAFARI9': {
142+
base: 'SauceLabs',
143+
browserName: 'safari',
144+
// platform: 'OS X 10.11',
145+
version: '9.0'
146+
},
147+
'SL_SAFARI10': {
148+
base: 'SauceLabs',
149+
browserName: 'safari',
150+
// platform: 'OS X 10.11',
151+
version: '10.0'
152+
}
153+
}
154+
});
155+
156+
157+
configuration.browsers = Object.keys(configuration.customLaunchers);
158+
}
159+
160+
config.set(configuration);
161+
};

karma.conf.js

Lines changed: 14 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,161 +1,21 @@
1-
// Karma configuration file, see link for more information
2-
// https://karma-runner.github.io/0.13/config/configuration-file.html
3-
4-
const customLaunchers = require('./scripts/sauce-browsers').customLaunchers;
5-
6-
module.exports = function (config) {
7-
const configuration = {
8-
basePath: '',
9-
frameworks: ['jasmine', '@angular/cli'],
10-
plugins: [
11-
require('karma-jasmine'),
12-
require('karma-chrome-launcher'),
13-
require('karma-firefox-launcher'),
14-
require('karma-jasmine-html-reporter'),
15-
require('karma-coverage-istanbul-reporter'),
16-
require('@angular/cli/plugins/karma'),
17-
require('karma-sauce-launcher')
18-
],
1+
module.exports = function(config) {
2+
config.set({
3+
frameworks: ["jasmine", "karma-typescript"],
194
files: [
20-
{pattern: './scripts/test.ts', watched: false}
5+
{ pattern: "src/bs-moment/**/*.+(ts|html)" }
216
],
227
preprocessors: {
23-
'./scripts/test.ts': ['@angular/cli']
24-
},
25-
coverageIstanbulReporter: {
26-
reports: ['html', 'lcovonly'],
27-
fixWebpackSourcePaths: true
8+
"**/*.ts": "karma-typescript"
289
},
29-
angularCli: {
30-
environment: 'dev'
31-
},
32-
reporters: config.angularCli && config.angularCli.codeCoverage
33-
? ['dots', 'coverage-istanbul']
34-
: ['dots', 'kjhtml'],
35-
port: 9876,
36-
colors: true,
37-
logLevel: config.LOG_INFO,
38-
autoWatch: true,
39-
browsers: ['Chrome'],
40-
browserNoActivityTimeout: 20000,
41-
browserDisconnectTolerance: 2,
42-
browserDisconnectTimeout: 5000,
43-
singleRun: false,
44-
customLaunchers: {
45-
Chrome_travis_ci: {
46-
base: 'ChromeHeadless',
47-
flags: [
48-
'--headless',
49-
'--disable-gpu',
50-
'--no-sandbox',
51-
'--remote-debugging-port=9222'
52-
]
53-
}
54-
},
55-
mime: {'text/x-typescript': ['ts', 'tsx']},
56-
client: {captureConsole: true, clearContext: false}
57-
};
58-
59-
if (process.env.TRAVIS) {
60-
configuration.browsers = ['Chrome_travis_ci'];
61-
}
62-
63-
if (process.env.SAUCE) {
64-
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
65-
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');
66-
process.exit(1);
67-
}
68-
69-
configuration.plugins.push(require('karma-sauce-launcher'));
70-
Object.assign(configuration, {
71-
logLevel: config.LOG_INFO,
72-
reporters: ['dots', 'saucelabs'],
73-
singleRun: false,
74-
concurrency: 2,
75-
captureTimeout: 60000,
76-
sauceLabs: {
77-
testName: 'ngx-bootstrap',
78-
build: process.env.TRAVIS_JOB_NUMBER,
79-
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
80-
retryLimit: 5,
81-
startConnect: false,
82-
recordVideo: false,
83-
recordScreenshots: false,
84-
options: {
85-
'command-timeout': 600,
86-
'idle-timeout': 600,
87-
'max-duration': 5400
88-
}
10+
reporters: ["progress", "karma-typescript"],
11+
browsers: ["ChromeHeadless"],
12+
karmaTypescriptConfig: {
13+
bundlerOptions: {
14+
entrypoints: /\.spec\.ts$/
8915
},
90-
customLaunchers: {
91-
'SL_CHROME': {
92-
base: 'SauceLabs',
93-
browserName: 'chrome',
94-
version: 'latest'
95-
},
96-
'SL_CHROME_1': {
97-
base: 'SauceLabs',
98-
browserName: 'chrome',
99-
version: 'latest-1'
100-
},
101-
'SL_FIREFOX': {
102-
base: 'SauceLabs',
103-
browserName: 'firefox',
104-
version: 'latest'
105-
},
106-
'SL_FIREFOX_1': {
107-
base: 'SauceLabs',
108-
browserName: 'firefox',
109-
version: 'latest-1'
110-
},
111-
'SL_IE10': {
112-
base: 'SauceLabs',
113-
browserName: 'internet explorer',
114-
// platform: 'Windows 2012',
115-
version: '10'
116-
},
117-
'SL_IE11': {
118-
base: 'SauceLabs',
119-
browserName: 'internet explorer',
120-
platform: 'Windows 8.1',
121-
version: '11.0'
122-
},
123-
'SL_EDGE13': {
124-
base: 'SauceLabs',
125-
browserName: 'MicrosoftEdge',
126-
platform: 'Windows 10',
127-
version: '13'
128-
},
129-
'SL_EDGE14': {
130-
base: 'SauceLabs',
131-
browserName: 'MicrosoftEdge',
132-
platform: 'Windows 10',
133-
version: '14'
134-
},
135-
'SL_EDGE15': {
136-
base: 'SauceLabs',
137-
browserName: 'MicrosoftEdge',
138-
platform: 'Windows 10',
139-
version: '15'
140-
},
141-
'SL_SAFARI9': {
142-
base: 'SauceLabs',
143-
browserName: 'safari',
144-
// platform: 'OS X 10.11',
145-
version: '9.0'
146-
},
147-
'SL_SAFARI10': {
148-
base: 'SauceLabs',
149-
browserName: 'safari',
150-
// platform: 'OS X 10.11',
151-
version: '10.0'
152-
}
16+
compilerOptions: {
17+
lib: ["ES2015", "DOM"]
15318
}
154-
});
155-
156-
157-
configuration.browsers = Object.keys(configuration.customLaunchers);
158-
}
159-
160-
config.set(configuration);
19+
}
20+
});
16121
};

mocha.opts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--compilers ts:ts-node/register
2+
src/bs-moment/**/*.spec.ts

0 commit comments

Comments
 (0)