Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
mytime
Commits
d8962e07
Commit
d8962e07
authored
Sep 04, 2018
by
Muneer Alam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Time picker implementation changes
parent
bca82fc0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
20 deletions
+45
-20
ReportsController.js
src/main/webapp/WEB-INF/controllers/ReportsController.js
+36
-9
reports.html
src/main/webapp/WEB-INF/templates/reports.html
+9
-11
No files found.
src/main/webapp/WEB-INF/controllers/ReportsController.js
View file @
d8962e07
...
@@ -74,12 +74,14 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
...
@@ -74,12 +74,14 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
}
}
var
parentData
=
{
var
parentData
=
{
"empId"
:
""
,
"empId"
:
""
,
"fromDate"
:
getFormattedDate
(
$scope
.
fromDate
),
"fromDate"
:
getFormattedDate
(
$scope
.
fromDate
),
"toDate"
:
getFormattedDate
(
$scope
.
toDate
),
"toDate"
:
getFormattedDate
(
$scope
.
toDate
),
"toEmail"
:
[],
"fromTime"
:
$scope
.
fromTime
,
"ccEmail"
:
[],
"toTime"
:
$scope
.
toTime
,
"bccEmail"
:
[]
"toEmail"
:
[],
"ccEmail"
:
[],
"bccEmail"
:
[]
};
};
$scope
.
validateEmpId
=
function
(){
$scope
.
validateEmpId
=
function
(){
...
@@ -102,6 +104,13 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
...
@@ -102,6 +104,13 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
function
checkEmpIdRange
(
searchId
){
function
checkEmpIdRange
(
searchId
){
return
parseInt
(
searchId
)
>=
appConfig
.
empStartId
&&
parseInt
(
searchId
)
<=
appConfig
.
empEndId
;
return
parseInt
(
searchId
)
>=
appConfig
.
empStartId
&&
parseInt
(
searchId
)
<=
appConfig
.
empEndId
;
}
}
$scope
.
showOrHide
=
function
()
{
if
(
!
$scope
.
isOverride
)
{
$scope
.
fromTime
=
""
;
$scope
.
toTime
=
""
;
}
}
$scope
.
generateReport
=
function
(){
$scope
.
generateReport
=
function
(){
debugger
;
debugger
;
...
@@ -111,14 +120,33 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
...
@@ -111,14 +120,33 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
parentData
.
empId
=
$scope
.
searchId
;
parentData
.
empId
=
$scope
.
searchId
;
parentData
.
fromDate
=
getFormattedDate
(
$scope
.
fromDate
);
parentData
.
fromDate
=
getFormattedDate
(
$scope
.
fromDate
);
parentData
.
toDate
=
getFormattedDate
(
$scope
.
toDate
);
parentData
.
toDate
=
getFormattedDate
(
$scope
.
toDate
);
parentData
.
fromTime
=
$scope
.
fromTime
;
parentData
.
fromTime
=
changeTime
(
$scope
.
fromTime
)
;
parentData
.
toTime
=
$scope
.
toTime
;
parentData
.
toTime
=
changeTime
(
$scope
.
toTime
)
;
parentData
.
isOverride
=
$scope
.
isOverride
;
parentData
.
isOverride
=
$scope
.
isOverride
;
generatePdfReport
(
parentData
);
generatePdfReport
(
parentData
);
showProgressDialog
();
showProgressDialog
();
$timeout
(
function
(){
previewPdfReport
();},
6000
);
$timeout
(
function
(){
previewPdfReport
();},
6000
);
};
};
function
changeTime
(
time
)
{
var
today
=
new
Date
(
time
);
var
hours
=
today
.
getHours
();
var
minutes
=
Math
.
round
(
today
.
getMinutes
());
var
ampm
=
hours
>=
12
?
'PM'
:
'AM'
;
var
time
=
hours
+
':'
+
minutes
;
return
changeTimeFormat
(
time
,
ampm
)
+
' '
+
ampm
;
}
function
changeTimeFormat
(
time
,
ampm
)
{
function
appendZero
(
n
)
{
return
(
n
<
10
?
'0'
:
''
)
+
n
;
}
var
bits
=
time
.
split
(
':'
);
if
(
ampm
==
'PM'
)
{
bits
[
0
]
=
bits
[
0
]
-
12
;
}
return
appendZero
(
bits
[
0
])
+
':'
+
appendZero
(
bits
[
1
]);
}
function
deletePreviousReport
(){
function
deletePreviousReport
(){
var
empId
=
""
;
var
empId
=
""
;
if
(
parentData
.
empId
!=
""
){
if
(
parentData
.
empId
!=
""
){
...
@@ -189,7 +217,6 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
...
@@ -189,7 +217,6 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
});
});
}
}
function
getFormattedDate
(
date
){
function
getFormattedDate
(
date
){
var
day
=
date
.
getDate
();
var
day
=
date
.
getDate
();
var
month
=
date
.
getMonth
()
+
1
;
var
month
=
date
.
getMonth
()
+
1
;
...
...
src/main/webapp/WEB-INF/templates/reports.html
View file @
d8962e07
...
@@ -55,19 +55,17 @@
...
@@ -55,19 +55,17 @@
<div
class=
"form-group col-lg-4"
>
<div
class=
"form-group col-lg-4"
>
<label>
Override Timings
</label>
<label>
Override Timings
</label>
<input
type=
"checkbox"
ng-value=
"isOverride"
ng-model=
"isOverride"
/>
<input
type=
"checkbox"
ng-value=
"isOverride"
ng-model=
"isOverride"
ng-change=
"showOrHide()"
/>
{{isOverride}}
</div>
</div>
<div
class=
"form-group col-lg-4 col-md-4 col-sm-6 col-xs-12"
>
<div
class=
"form-group col-lg-4 col-md-4 col-sm-6 col-xs-12"
ng-show=
"isOverride"
>
<label
for=
""
>
FromTime:
<input
type=
"time"
ng-model=
"fromTime"
id=
"Hours"
<label
for=
"fromTime"
>
FromTime:
<input
type=
"time"
ng-model=
"fromTime"
id=
"Hours"
placeholder=
"Enter Hours"
class=
"form-control"
placeholder=
"HH:mm aa"
class=
"form-control"
/>
/></label>
</label>
</div>
</div>
<div
class=
"form-group col-lg-4 col-md-4 col-sm-6 col-xs-12"
>
<div
class=
"form-group col-lg-4 col-md-4 col-sm-6 col-xs-12"
ng-show=
"isOverride"
>
<label
for=
""
>
ToTime:
<input
type=
"time"
ng-model=
"toTime"
id=
"Hours"
<label
for=
"
toTime
"
>
ToTime:
<input
type=
"time"
ng-model=
"toTime"
id=
"Hours"
placeholder=
"
Enter Hours"
class=
"form-control"
placeholder=
"
HH:mm aa"
class=
"form-control"
/>
/>
</label>
</label>
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment