Skip to content

Commit c15acc7

Browse files
authored
Add files via upload
1 parent f7e2635 commit c15acc7

29 files changed

+761
-2
lines changed

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
1-
# ej2-angular-7-datetimepicker
2-
A quick start project that helps you to create an Angular 7 Calendar with minimal code configuration.
1+
2+
# EJ2 Angular 7 DateTimePicker Quick Start
3+
A quick start project that helps you to create the Syncfusion Angular 7 DateTimePicker.
4+
5+
6+
![Angular 7 DateTimePicker](angular7datetimepicker.png "Angualar 7 DateTimePicker")
7+
8+
This is a Angular 7 project generated using [Angular CLI](https://github.com/angular/angular-cli) version 7.0.4. The Datetimepicker features included in this project are as follows.
9+
10+
* Min - Starting date that can be selected.
11+
* Max - Last date that can be selected.
12+
13+
## How to run this application?
14+
To run this application, you need to first clone the `ej2-angular-7-datetimepicker` repository and then navigate to its appropriate path where it has been located in your system.
15+
16+
To do so, open the command prompt and run the below commands one after the other.
17+
18+
```
19+
git clone https://github.com/SyncfusionExamples/ej2-angular-7-datetimepicker ej2-angular-7-datetimepicker
20+
cd ej2-angular-7-datetimepicker
21+
```
22+
23+
## Installing
24+
Once done with downloading, next you need to install the necessary packages required to run this application locally. The `npm install` command will install all the needed angular packages into your current project and to do so, run the below command.
25+
26+
```
27+
npm install
28+
```
29+
30+
## Running on development server
31+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
32+
33+
## Further help
34+
35+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

angular.json

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"datetimepickerKb": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {},
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist/datetimepickerKb",
17+
"index": "src/index.html",
18+
"main": "src/main.ts",
19+
"polyfills": "src/polyfills.ts",
20+
"tsConfig": "src/tsconfig.app.json",
21+
"assets": [
22+
"src/favicon.ico",
23+
"src/assets"
24+
],
25+
"styles": [
26+
"src/styles.css"
27+
],
28+
"scripts": []
29+
},
30+
"configurations": {
31+
"production": {
32+
"fileReplacements": [
33+
{
34+
"replace": "src/environments/environment.ts",
35+
"with": "src/environments/environment.prod.ts"
36+
}
37+
],
38+
"optimization": true,
39+
"outputHashing": "all",
40+
"sourceMap": false,
41+
"extractCss": true,
42+
"namedChunks": false,
43+
"aot": true,
44+
"extractLicenses": true,
45+
"vendorChunk": false,
46+
"buildOptimizer": true,
47+
"budgets": [
48+
{
49+
"type": "initial",
50+
"maximumWarning": "2mb",
51+
"maximumError": "5mb"
52+
}
53+
]
54+
}
55+
}
56+
},
57+
"serve": {
58+
"builder": "@angular-devkit/build-angular:dev-server",
59+
"options": {
60+
"browserTarget": "datetimepickerKb:build"
61+
},
62+
"configurations": {
63+
"production": {
64+
"browserTarget": "datetimepickerKb:build:production"
65+
}
66+
}
67+
},
68+
"extract-i18n": {
69+
"builder": "@angular-devkit/build-angular:extract-i18n",
70+
"options": {
71+
"browserTarget": "datetimepickerKb:build"
72+
}
73+
},
74+
"test": {
75+
"builder": "@angular-devkit/build-angular:karma",
76+
"options": {
77+
"main": "src/test.ts",
78+
"polyfills": "src/polyfills.ts",
79+
"tsConfig": "src/tsconfig.spec.json",
80+
"karmaConfig": "src/karma.conf.js",
81+
"styles": [
82+
"src/styles.css"
83+
],
84+
"scripts": [],
85+
"assets": [
86+
"src/favicon.ico",
87+
"src/assets"
88+
]
89+
}
90+
},
91+
"lint": {
92+
"builder": "@angular-devkit/build-angular:tslint",
93+
"options": {
94+
"tsConfig": [
95+
"src/tsconfig.app.json",
96+
"src/tsconfig.spec.json"
97+
],
98+
"exclude": [
99+
"**/node_modules/**"
100+
]
101+
}
102+
}
103+
}
104+
},
105+
"datetimepickerKb-e2e": {
106+
"root": "e2e/",
107+
"projectType": "application",
108+
"prefix": "",
109+
"architect": {
110+
"e2e": {
111+
"builder": "@angular-devkit/build-angular:protractor",
112+
"options": {
113+
"protractorConfig": "e2e/protractor.conf.js",
114+
"devServerTarget": "datetimepickerKb:serve"
115+
},
116+
"configurations": {
117+
"production": {
118+
"devServerTarget": "datetimepickerKb:serve:production"
119+
}
120+
}
121+
},
122+
"lint": {
123+
"builder": "@angular-devkit/build-angular:tslint",
124+
"options": {
125+
"tsConfig": "e2e/tsconfig.e2e.json",
126+
"exclude": [
127+
"**/node_modules/**"
128+
]
129+
}
130+
}
131+
}
132+
}
133+
},
134+
"defaultProject": "datetimepickerKb"
135+
}

angular7datetimepicker.png

15.4 KB
Loading

e2e/protractor.conf.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Protractor configuration file, see link for more information
2+
// https://github.com/angular/protractor/blob/master/lib/config.ts
3+
4+
const { SpecReporter } = require('jasmine-spec-reporter');
5+
6+
exports.config = {
7+
allScriptsTimeout: 11000,
8+
specs: [
9+
'./src/**/*.e2e-spec.ts'
10+
],
11+
capabilities: {
12+
'browserName': 'chrome'
13+
},
14+
directConnect: true,
15+
baseUrl: 'http://localhost:4200/',
16+
framework: 'jasmine',
17+
jasmineNodeOpts: {
18+
showColors: true,
19+
defaultTimeoutInterval: 30000,
20+
print: function() {}
21+
},
22+
onPrepare() {
23+
require('ts-node').register({
24+
project: require('path').join(__dirname, './tsconfig.e2e.json')
25+
});
26+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27+
}
28+
};

e2e/src/app.e2e-spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { AppPage } from './app.po';
2+
3+
describe('workspace-project App', () => {
4+
let page: AppPage;
5+
6+
beforeEach(() => {
7+
page = new AppPage();
8+
});
9+
10+
it('should display welcome message', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('Welcome to datetimepickerKb!');
13+
});
14+
});

e2e/src/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get('/');
6+
}
7+
8+
getParagraphText() {
9+
return element(by.css('app-root h1')).getText();
10+
}
11+
}

e2e/tsconfig.e2e.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/app",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}

package.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "datetimepicker-kb",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"test": "ng test",
9+
"lint": "ng lint",
10+
"e2e": "ng e2e"
11+
},
12+
"private": true,
13+
"dependencies": {
14+
"@angular/animations": "~7.0.0",
15+
"@angular/common": "~7.0.0",
16+
"@angular/compiler": "~7.0.0",
17+
"@angular/core": "~7.0.0",
18+
"@angular/forms": "~7.0.0",
19+
"@angular/http": "~7.0.0",
20+
"@angular/platform-browser": "~7.0.0",
21+
"@angular/platform-browser-dynamic": "~7.0.0",
22+
"@angular/router": "~7.0.0",
23+
"@syncfusion/ej2-angular-calendars": "^17.1.49",
24+
"core-js": "^2.5.4",
25+
"rxjs": "~6.3.3",
26+
"zone.js": "~0.8.26"
27+
},
28+
"devDependencies": {
29+
"@angular-devkit/build-angular": "~0.10.0",
30+
"@angular/cli": "~7.0.4",
31+
"@angular/compiler-cli": "~7.0.0",
32+
"@angular/language-service": "~7.0.0",
33+
"@types/node": "~8.9.4",
34+
"@types/jasmine": "~2.8.8",
35+
"@types/jasminewd2": "~2.0.3",
36+
"codelyzer": "~4.5.0",
37+
"jasmine-core": "~2.99.1",
38+
"jasmine-spec-reporter": "~4.2.1",
39+
"karma": "~3.0.0",
40+
"karma-chrome-launcher": "~2.2.0",
41+
"karma-coverage-istanbul-reporter": "~2.0.1",
42+
"karma-jasmine": "~1.1.2",
43+
"karma-jasmine-html-reporter": "^0.2.2",
44+
"protractor": "~5.4.0",
45+
"ts-node": "~7.0.0",
46+
"tslint": "~5.11.0",
47+
"typescript": "~3.1.1"
48+
}
49+
}

src/app/app-routing.module.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
const routes: Routes = [];
5+
6+
@NgModule({
7+
imports: [RouterModule.forRoot(routes)],
8+
exports: [RouterModule]
9+
})
10+
export class AppRoutingModule { }

src/app/app.component.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#control_wrapper {
2+
max-width: 246px;
3+
margin: 30px auto;
4+
padding-top: 50px;
5+
}
6+
#header {
7+
text-align:center;
8+
}

src/app/app.component.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div id="header">
2+
<h1>
3+
Angular 7 DateTimePicker
4+
</h1>
5+
</div>
6+
<div id="control_wrapper">
7+
<ejs-datetimepicker id='datetimepicker' format='yyy.MM.dd HH:mm' placeholder='Select a date' [value]='dateValue' [min]='minDate' [max]='maxDate'></ejs-datetimepicker>
8+
</div>

src/app/app.component.spec.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { TestBed, async } from '@angular/core/testing';
2+
import { RouterTestingModule } from '@angular/router/testing';
3+
import { AppComponent } from './app.component';
4+
5+
describe('AppComponent', () => {
6+
beforeEach(async(() => {
7+
TestBed.configureTestingModule({
8+
imports: [
9+
RouterTestingModule
10+
],
11+
declarations: [
12+
AppComponent
13+
],
14+
}).compileComponents();
15+
}));
16+
17+
it('should create the app', () => {
18+
const fixture = TestBed.createComponent(AppComponent);
19+
const app = fixture.debugElement.componentInstance;
20+
expect(app).toBeTruthy();
21+
});
22+
23+
it(`should have as title 'datetimepickerKb'`, () => {
24+
const fixture = TestBed.createComponent(AppComponent);
25+
const app = fixture.debugElement.componentInstance;
26+
expect(app.title).toEqual('datetimepickerKb');
27+
});
28+
29+
it('should render title in a h1 tag', () => {
30+
const fixture = TestBed.createComponent(AppComponent);
31+
fixture.detectChanges();
32+
const compiled = fixture.debugElement.nativeElement;
33+
expect(compiled.querySelector('h1').textContent).toContain('Welcome to datetimepickerKb!');
34+
});
35+
});

src/app/app.component.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {Component} from '@angular/core';
2+
3+
@Component ({
4+
selector: 'app-root',
5+
templateUrl: './app.component.html'
6+
})
7+
8+
export class AppComponent {
9+
public minDate: Date = new Date ("05/07/2017 2:00 AM");
10+
public maxDate: Date = new Date ("05/27/2017 11:00 AM");
11+
public dateValue: Date = new Date ("05/16/2017 5:00 AM");
12+
constructor () {}
13+
}

src/app/app.module.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
import { DateTimePickerModule } from '@syncfusion/ej2-angular-calendars';
4+
import { AppComponent } from './app.component';
5+
6+
@NgModule({
7+
imports: [ BrowserModule, DateTimePickerModule ],
8+
declarations: [ AppComponent ],
9+
bootstrap: [ AppComponent ]
10+
})
11+
export class AppModule { }

0 commit comments

Comments
 (0)