Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
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
dataplatform
atlas
Commits
39892854
Commit
39892854
authored
Oct 14, 2020
by
kevalbhatt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3986: UI Allow user to update the date format from JAVA property file
parent
94d43c63
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
71 additions
and
34 deletions
+71
-34
main.js
dashboardv2/public/js/main.js
+10
-0
Globals.js
dashboardv2/public/js/utils/Globals.js
+6
-3
Utils.js
dashboardv2/public/js/utils/Utils.js
+9
-11
CreateAuditTableLayoutView.js
...ardv2/public/js/views/audit/CreateAuditTableLayoutView.js
+7
-0
QueryBuilderView.js
dashboardv2/public/js/views/search/QueryBuilderView.js
+2
-2
Statistics.js
dashboardv2/public/js/views/site/Statistics.js
+1
-1
main.js
dashboardv3/public/js/main.js
+10
-0
Globals.js
dashboardv3/public/js/utils/Globals.js
+7
-3
Utils.js
dashboardv3/public/js/utils/Utils.js
+9
-11
CreateAuditTableLayoutView.js
...ardv3/public/js/views/audit/CreateAuditTableLayoutView.js
+7
-0
QueryBuilderView.js
dashboardv3/public/js/views/search/QueryBuilderView.js
+2
-2
Statistics.js
dashboardv3/public/js/views/site/Statistics.js
+1
-1
No files found.
dashboardv2/public/js/main.js
View file @
39892854
...
...
@@ -272,6 +272,16 @@ require(['App',
if
(
response
[
'atlas.ui.default.version'
]
!==
undefined
)
{
Globals
.
DEFAULT_UI
=
response
[
'atlas.ui.default.version'
];
}
if
(
response
[
'atlas.ui.date.format'
]
!==
undefined
)
{
Globals
.
dateTimeFormat
=
response
[
'atlas.ui.date.format'
];
var
dateFormatSeperated
=
Globals
.
dateTimeFormat
.
split
(
' '
);
if
(
dateFormatSeperated
[
0
])
{
Globals
.
dateFormat
=
dateFormatSeperated
[
0
];
//date
}
}
if
(
response
[
'atlas.ui.date.timezone'
]
!==
undefined
)
{
Globals
.
isDateTimeZone
=
response
[
'atlas.ui.date.timezone'
];
}
}
--
that
.
asyncFetchCounter
;
startApp
();
...
...
dashboardv2/public/js/utils/Globals.js
View file @
39892854
...
...
@@ -40,9 +40,11 @@ define(["require"], function(require) {
Globals
.
serviceTypeMap
=
{};
Globals
.
entityImgPath
=
"/img/entity-icon/"
;
Globals
.
DEFAULT_UI
=
"v2"
;
Globals
.
dateFormat
=
"YYYY/MM/DD"
;
Globals
.
dateTimeFormat
=
"YYYY/MM/DD HH:mm:ss"
;
Globals
.
meridiemFormat
=
"MM/DD/YYYY h:mm A z"
;
// Date Format
Globals
.
dateTimeFormat
=
"MM/DD/YYYY hh:mm:ss A"
;
Globals
.
dateFormat
=
"MM/DD/YYYY"
;
Globals
.
isDateTimeZone
=
true
;
return
Globals
;
});
\ No newline at end of file
dashboardv2/public/js/utils/Utils.js
View file @
39892854
...
...
@@ -917,32 +917,30 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
var
dateValue
=
null
,
dateFormat
=
Globals
.
dateTimeFormat
,
isValidDate
=
false
;
if
(
options
)
{
if
(
options
.
dateFormat
)
{
dateFormat
=
options
.
dateFormat
;
}
if
(
options
.
date
)
{
if
(
options
.
date
===
"-"
)
{
if
(
options
&&
options
.
date
)
{
dateValue
=
options
.
date
;
}
else
{
dateValue
=
moment
(
options
.
date
)
if
(
dateValue
!==
"-"
)
{
dateValue
=
parseInt
(
dateValue
);
if
(
_
.
isNaN
(
dateValue
))
{
dateValue
=
options
.
date
;
}
dateValue
=
moment
(
dateValue
);
if
(
dateValue
.
_isValid
)
{
isValidDate
=
true
;
dateValue
=
dateValue
.
format
(
dateFormat
);
}
}
}
}
if
(
dateValue
!==
"-"
)
{
if
(
isValidDate
===
false
&&
options
&&
options
.
defaultDate
!==
false
)
{
dateValue
=
moment
().
format
(
dateFormat
);
}
if
(
Globals
.
isDateTimeZone
)
{
if
(
!
options
||
options
&&
options
.
zone
!==
false
)
{
dateValue
+=
" ("
+
moment
.
tz
(
moment
.
tz
.
guess
()).
zoneAbbr
()
+
")"
;
}
}
}
return
dateValue
;
}
return
Utils
;
...
...
dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
View file @
39892854
...
...
@@ -75,6 +75,13 @@ define(['require',
createTableWithValues
:
function
(
tableDetails
)
{
var
attrTable
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
getValue
:
function
(
val
,
key
)
{
if
(
key
&&
key
.
toLowerCase
().
indexOf
(
"time"
)
>
0
)
{
return
Utils
.
formatDate
({
date
:
val
});
}
else
{
return
val
;
}
},
valueObject
:
tableDetails
});
return
attrTable
;
...
...
dashboardv2/public/js/views/search/QueryBuilderView.js
View file @
39892854
...
...
@@ -359,8 +359,8 @@ define(['require',
}
obj
.
singleDatePicker
=
false
;
}
else
{
obj
.
startDate
=
moment
(
valueObj
.
value
);
obj
.
endDate
=
moment
(
valueObj
.
value
)
;
obj
.
startDate
=
moment
(
Date
.
parse
(
valueObj
.
value
)
);
obj
.
endDate
=
obj
.
startDate
;
obj
.
singleDatePicker
=
true
;
}
}
...
...
dashboardv2/public/js/views/site/Statistics.js
View file @
39892854
...
...
@@ -491,7 +491,7 @@ define(['require',
if
(
type
==
'time'
)
{
return
Utils
.
millisecondsToTime
(
value
);
}
else
if
(
type
==
'day'
)
{
return
Utils
.
formatDate
({
date
:
value
,
dateFormat
:
Globals
.
meridiemFormat
})
return
Utils
.
formatDate
({
date
:
value
})
}
else
if
(
type
==
'number'
)
{
return
_
.
numberFormatWithComma
(
value
);
}
else
if
(
type
==
'millisecond'
)
{
...
...
dashboardv3/public/js/main.js
View file @
39892854
...
...
@@ -301,6 +301,16 @@ require(['App',
if
(
response
[
'atlas.ui.default.version'
]
!==
undefined
)
{
Globals
.
DEFAULT_UI
=
response
[
'atlas.ui.default.version'
];
}
if
(
response
[
'atlas.ui.date.format'
]
!==
undefined
)
{
Globals
.
dateTimeFormat
=
response
[
'atlas.ui.date.format'
];
var
dateFormatSeperated
=
Globals
.
dateTimeFormat
.
split
(
' '
);
if
(
dateFormatSeperated
[
0
])
{
Globals
.
dateFormat
=
dateFormatSeperated
[
0
];
//date
}
}
if
(
response
[
'atlas.ui.date.timezone'
]
!==
undefined
)
{
Globals
.
isDateTimeZone
=
response
[
'atlas.ui.date.timezone'
];
}
}
--
that
.
asyncFetchCounter
;
startApp
();
...
...
dashboardv3/public/js/utils/Globals.js
View file @
39892854
...
...
@@ -40,8 +40,11 @@ define(["require"], function(require) {
Globals
.
serviceTypeMap
=
{};
Globals
.
entityImgPath
=
"/img/entity-icon/"
;
Globals
.
DEFAULT_UI
=
"v2"
;
Globals
.
dateFormat
=
"YYYY/MM/DD"
;
Globals
.
dateTimeFormat
=
"YYYY/MM/DD HH:mm:ss"
;
Globals
.
meridiemFormat
=
"MM/DD/YYYY h:mm A z"
;
// Date Format
Globals
.
dateTimeFormat
=
"MM/DD/YYYY hh:mm:ss A"
;
Globals
.
dateFormat
=
"MM/DD/YYYY"
;
Globals
.
isDateTimeZone
=
true
;
return
Globals
;
});
\ No newline at end of file
dashboardv3/public/js/utils/Utils.js
View file @
39892854
...
...
@@ -922,32 +922,30 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
var
dateValue
=
null
,
dateFormat
=
Globals
.
dateTimeFormat
,
isValidDate
=
false
;
if
(
options
)
{
if
(
options
.
dateFormat
)
{
dateFormat
=
options
.
dateFormat
;
}
if
(
options
.
date
)
{
if
(
options
.
date
===
"-"
)
{
if
(
options
&&
options
.
date
)
{
dateValue
=
options
.
date
;
}
else
{
dateValue
=
moment
(
options
.
date
)
if
(
dateValue
!==
"-"
)
{
dateValue
=
parseInt
(
dateValue
);
if
(
_
.
isNaN
(
dateValue
))
{
dateValue
=
options
.
date
;
}
dateValue
=
moment
(
dateValue
);
if
(
dateValue
.
_isValid
)
{
isValidDate
=
true
;
dateValue
=
dateValue
.
format
(
dateFormat
);
}
}
}
}
if
(
dateValue
!==
"-"
)
{
if
(
isValidDate
===
false
&&
options
&&
options
.
defaultDate
!==
false
)
{
dateValue
=
moment
().
format
(
dateFormat
);
}
if
(
Globals
.
isDateTimeZone
)
{
if
(
!
options
||
options
&&
options
.
zone
!==
false
)
{
dateValue
+=
" ("
+
moment
.
tz
(
moment
.
tz
.
guess
()).
zoneAbbr
()
+
")"
;
}
}
}
return
dateValue
;
}
return
Utils
;
...
...
dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
View file @
39892854
...
...
@@ -75,6 +75,13 @@ define(['require',
createTableWithValues
:
function
(
tableDetails
)
{
var
attrTable
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
getValue
:
function
(
val
,
key
)
{
if
(
key
&&
key
.
toLowerCase
().
indexOf
(
"time"
)
>
0
)
{
return
Utils
.
formatDate
({
date
:
val
});
}
else
{
return
val
;
}
},
valueObject
:
tableDetails
});
return
attrTable
;
...
...
dashboardv3/public/js/views/search/QueryBuilderView.js
View file @
39892854
...
...
@@ -359,8 +359,8 @@ define(['require',
}
obj
.
singleDatePicker
=
false
;
}
else
{
obj
.
startDate
=
moment
(
valueObj
.
value
);
obj
.
endDate
=
moment
(
valueObj
.
value
)
;
obj
.
startDate
=
moment
(
Date
.
parse
(
valueObj
.
value
)
);
obj
.
endDate
=
obj
.
startDate
;
obj
.
singleDatePicker
=
true
;
}
}
...
...
dashboardv3/public/js/views/site/Statistics.js
View file @
39892854
...
...
@@ -398,7 +398,7 @@ define(['require',
if
(
type
==
'time'
)
{
return
Utils
.
millisecondsToTime
(
value
);
}
else
if
(
type
==
'day'
)
{
return
Utils
.
formatDate
({
date
:
value
,
dateFormat
:
Globals
.
meridiemFormat
})
return
Utils
.
formatDate
({
date
:
value
})
}
else
if
(
type
==
'number'
)
{
return
_
.
numberFormatWithComma
(
value
);
}
else
if
(
type
==
'millisecond'
)
{
...
...
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