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
9c10f73d
Unverified
Commit
9c10f73d
authored
Sep 04, 2018
by
nakavaram-nisum-com
Committed by
GitHub
Sep 04, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #178 from nisum-inc/FEATURE/MT-175-Timepicker-impl
Time picker implementation changes
parents
bca82fc0
d8962e07
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 @
9c10f73d
...
...
@@ -74,12 +74,14 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
}
var
parentData
=
{
"empId"
:
""
,
"fromDate"
:
getFormattedDate
(
$scope
.
fromDate
),
"toDate"
:
getFormattedDate
(
$scope
.
toDate
),
"toEmail"
:
[],
"ccEmail"
:
[],
"bccEmail"
:
[]
"empId"
:
""
,
"fromDate"
:
getFormattedDate
(
$scope
.
fromDate
),
"toDate"
:
getFormattedDate
(
$scope
.
toDate
),
"fromTime"
:
$scope
.
fromTime
,
"toTime"
:
$scope
.
toTime
,
"toEmail"
:
[],
"ccEmail"
:
[],
"bccEmail"
:
[]
};
$scope
.
validateEmpId
=
function
(){
...
...
@@ -102,6 +104,13 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
function
checkEmpIdRange
(
searchId
){
return
parseInt
(
searchId
)
>=
appConfig
.
empStartId
&&
parseInt
(
searchId
)
<=
appConfig
.
empEndId
;
}
$scope
.
showOrHide
=
function
()
{
if
(
!
$scope
.
isOverride
)
{
$scope
.
fromTime
=
""
;
$scope
.
toTime
=
""
;
}
}
$scope
.
generateReport
=
function
(){
debugger
;
...
...
@@ -111,14 +120,33 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
parentData
.
empId
=
$scope
.
searchId
;
parentData
.
fromDate
=
getFormattedDate
(
$scope
.
fromDate
);
parentData
.
toDate
=
getFormattedDate
(
$scope
.
toDate
);
parentData
.
fromTime
=
$scope
.
fromTime
;
parentData
.
toTime
=
$scope
.
toTime
;
parentData
.
fromTime
=
changeTime
(
$scope
.
fromTime
)
;
parentData
.
toTime
=
changeTime
(
$scope
.
toTime
)
;
parentData
.
isOverride
=
$scope
.
isOverride
;
generatePdfReport
(
parentData
);
showProgressDialog
();
$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
(){
var
empId
=
""
;
if
(
parentData
.
empId
!=
""
){
...
...
@@ -189,7 +217,6 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
});
}
function
getFormattedDate
(
date
){
var
day
=
date
.
getDate
();
var
month
=
date
.
getMonth
()
+
1
;
...
...
src/main/webapp/WEB-INF/templates/reports.html
View file @
9c10f73d
...
...
@@ -55,19 +55,17 @@
<div
class=
"form-group col-lg-4"
>
<label>
Override Timings
</label>
<input
type=
"checkbox"
ng-value=
"isOverride"
ng-model=
"isOverride"
/>
{{isOverride}}
<input
type=
"checkbox"
ng-value=
"isOverride"
ng-model=
"isOverride"
ng-change=
"showOrHide()"
/>
</div>
<div
class=
"form-group col-lg-4 col-md-4 col-sm-6 col-xs-12"
>
<label
for=
""
>
FromTime:
<input
type=
"time"
ng-model=
"fromTime"
id=
"Hours"
placeholder=
"Enter Hours"
class=
"form-control"
/></label>
<div
class=
"form-group col-lg-4 col-md-4 col-sm-6 col-xs-12"
ng-show=
"isOverride"
>
<label
for=
"fromTime"
>
FromTime:
<input
type=
"time"
ng-model=
"fromTime"
id=
"Hours"
placeholder=
"HH:mm aa"
class=
"form-control"
/>
</label>
</div>
<div
class=
"form-group col-lg-4 col-md-4 col-sm-6 col-xs-12"
>
<label
for=
""
>
ToTime:
<input
type=
"time"
ng-model=
"toTime"
id=
"Hours"
placeholder=
"
Enter Hours"
class=
"form-control"
/>
</label>
<div
class=
"form-group col-lg-4 col-md-4 col-sm-6 col-xs-12"
ng-show=
"isOverride"
>
<label
for=
"
toTime
"
>
ToTime:
<input
type=
"time"
ng-model=
"toTime"
id=
"Hours"
placeholder=
"
HH:mm aa"
class=
"form-control"
/>
</label>
</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