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
4 years ago
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',
...
@@ -272,6 +272,16 @@ require(['App',
if
(
response
[
'atlas.ui.default.version'
]
!==
undefined
)
{
if
(
response
[
'atlas.ui.default.version'
]
!==
undefined
)
{
Globals
.
DEFAULT_UI
=
response
[
'atlas.ui.default.version'
];
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
;
--
that
.
asyncFetchCounter
;
startApp
();
startApp
();
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/utils/Globals.js
View file @
39892854
...
@@ -40,9 +40,11 @@ define(["require"], function(require) {
...
@@ -40,9 +40,11 @@ define(["require"], function(require) {
Globals
.
serviceTypeMap
=
{};
Globals
.
serviceTypeMap
=
{};
Globals
.
entityImgPath
=
"/img/entity-icon/"
;
Globals
.
entityImgPath
=
"/img/entity-icon/"
;
Globals
.
DEFAULT_UI
=
"v2"
;
Globals
.
DEFAULT_UI
=
"v2"
;
Globals
.
dateFormat
=
"YYYY/MM/DD"
;
Globals
.
dateTimeFormat
=
"YYYY/MM/DD HH:mm:ss"
;
// Date Format
Globals
.
meridiemFormat
=
"MM/DD/YYYY h:mm A z"
;
Globals
.
dateTimeFormat
=
"MM/DD/YYYY hh:mm:ss A"
;
Globals
.
dateFormat
=
"MM/DD/YYYY"
;
Globals
.
isDateTimeZone
=
true
;
return
Globals
;
return
Globals
;
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/utils/Utils.js
View file @
39892854
...
@@ -917,32 +917,30 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
...
@@ -917,32 +917,30 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
var
dateValue
=
null
,
var
dateValue
=
null
,
dateFormat
=
Globals
.
dateTimeFormat
,
dateFormat
=
Globals
.
dateTimeFormat
,
isValidDate
=
false
;
isValidDate
=
false
;
if
(
options
)
{
if
(
options
&&
options
.
date
)
{
if
(
options
.
dateFormat
)
{
dateFormat
=
options
.
dateFormat
;
}
if
(
options
.
date
)
{
if
(
options
.
date
===
"-"
)
{
dateValue
=
options
.
date
;
dateValue
=
options
.
date
;
}
else
{
if
(
dateValue
!==
"-"
)
{
dateValue
=
moment
(
options
.
date
)
dateValue
=
parseInt
(
dateValue
);
if
(
_
.
isNaN
(
dateValue
))
{
dateValue
=
options
.
date
;
}
dateValue
=
moment
(
dateValue
);
if
(
dateValue
.
_isValid
)
{
if
(
dateValue
.
_isValid
)
{
isValidDate
=
true
;
isValidDate
=
true
;
dateValue
=
dateValue
.
format
(
dateFormat
);
dateValue
=
dateValue
.
format
(
dateFormat
);
}
}
}
}
}
}
}
if
(
dateValue
!==
"-"
)
{
if
(
dateValue
!==
"-"
)
{
if
(
isValidDate
===
false
&&
options
&&
options
.
defaultDate
!==
false
)
{
if
(
isValidDate
===
false
&&
options
&&
options
.
defaultDate
!==
false
)
{
dateValue
=
moment
().
format
(
dateFormat
);
dateValue
=
moment
().
format
(
dateFormat
);
}
}
if
(
Globals
.
isDateTimeZone
)
{
if
(
!
options
||
options
&&
options
.
zone
!==
false
)
{
if
(
!
options
||
options
&&
options
.
zone
!==
false
)
{
dateValue
+=
" ("
+
moment
.
tz
(
moment
.
tz
.
guess
()).
zoneAbbr
()
+
")"
;
dateValue
+=
" ("
+
moment
.
tz
(
moment
.
tz
.
guess
()).
zoneAbbr
()
+
")"
;
}
}
}
}
}
return
dateValue
;
return
dateValue
;
}
}
return
Utils
;
return
Utils
;
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
View file @
39892854
...
@@ -75,6 +75,13 @@ define(['require',
...
@@ -75,6 +75,13 @@ define(['require',
createTableWithValues
:
function
(
tableDetails
)
{
createTableWithValues
:
function
(
tableDetails
)
{
var
attrTable
=
CommonViewFunction
.
propertyTable
({
var
attrTable
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
scope
:
this
,
getValue
:
function
(
val
,
key
)
{
if
(
key
&&
key
.
toLowerCase
().
indexOf
(
"time"
)
>
0
)
{
return
Utils
.
formatDate
({
date
:
val
});
}
else
{
return
val
;
}
},
valueObject
:
tableDetails
valueObject
:
tableDetails
});
});
return
attrTable
;
return
attrTable
;
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/search/QueryBuilderView.js
View file @
39892854
...
@@ -359,8 +359,8 @@ define(['require',
...
@@ -359,8 +359,8 @@ define(['require',
}
}
obj
.
singleDatePicker
=
false
;
obj
.
singleDatePicker
=
false
;
}
else
{
}
else
{
obj
.
startDate
=
moment
(
valueObj
.
value
);
obj
.
startDate
=
moment
(
Date
.
parse
(
valueObj
.
value
)
);
obj
.
endDate
=
moment
(
valueObj
.
value
)
;
obj
.
endDate
=
obj
.
startDate
;
obj
.
singleDatePicker
=
true
;
obj
.
singleDatePicker
=
true
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/site/Statistics.js
View file @
39892854
...
@@ -491,7 +491,7 @@ define(['require',
...
@@ -491,7 +491,7 @@ define(['require',
if
(
type
==
'time'
)
{
if
(
type
==
'time'
)
{
return
Utils
.
millisecondsToTime
(
value
);
return
Utils
.
millisecondsToTime
(
value
);
}
else
if
(
type
==
'day'
)
{
}
else
if
(
type
==
'day'
)
{
return
Utils
.
formatDate
({
date
:
value
,
dateFormat
:
Globals
.
meridiemFormat
})
return
Utils
.
formatDate
({
date
:
value
})
}
else
if
(
type
==
'number'
)
{
}
else
if
(
type
==
'number'
)
{
return
_
.
numberFormatWithComma
(
value
);
return
_
.
numberFormatWithComma
(
value
);
}
else
if
(
type
==
'millisecond'
)
{
}
else
if
(
type
==
'millisecond'
)
{
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/main.js
View file @
39892854
...
@@ -301,6 +301,16 @@ require(['App',
...
@@ -301,6 +301,16 @@ require(['App',
if
(
response
[
'atlas.ui.default.version'
]
!==
undefined
)
{
if
(
response
[
'atlas.ui.default.version'
]
!==
undefined
)
{
Globals
.
DEFAULT_UI
=
response
[
'atlas.ui.default.version'
];
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
;
--
that
.
asyncFetchCounter
;
startApp
();
startApp
();
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/utils/Globals.js
View file @
39892854
...
@@ -40,8 +40,11 @@ define(["require"], function(require) {
...
@@ -40,8 +40,11 @@ define(["require"], function(require) {
Globals
.
serviceTypeMap
=
{};
Globals
.
serviceTypeMap
=
{};
Globals
.
entityImgPath
=
"/img/entity-icon/"
;
Globals
.
entityImgPath
=
"/img/entity-icon/"
;
Globals
.
DEFAULT_UI
=
"v2"
;
Globals
.
DEFAULT_UI
=
"v2"
;
Globals
.
dateFormat
=
"YYYY/MM/DD"
;
Globals
.
dateTimeFormat
=
"YYYY/MM/DD HH:mm:ss"
;
// Date Format
Globals
.
meridiemFormat
=
"MM/DD/YYYY h:mm A z"
;
Globals
.
dateTimeFormat
=
"MM/DD/YYYY hh:mm:ss A"
;
Globals
.
dateFormat
=
"MM/DD/YYYY"
;
Globals
.
isDateTimeZone
=
true
;
return
Globals
;
return
Globals
;
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/utils/Utils.js
View file @
39892854
...
@@ -922,32 +922,30 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
...
@@ -922,32 +922,30 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
var
dateValue
=
null
,
var
dateValue
=
null
,
dateFormat
=
Globals
.
dateTimeFormat
,
dateFormat
=
Globals
.
dateTimeFormat
,
isValidDate
=
false
;
isValidDate
=
false
;
if
(
options
)
{
if
(
options
&&
options
.
date
)
{
if
(
options
.
dateFormat
)
{
dateFormat
=
options
.
dateFormat
;
}
if
(
options
.
date
)
{
if
(
options
.
date
===
"-"
)
{
dateValue
=
options
.
date
;
dateValue
=
options
.
date
;
}
else
{
if
(
dateValue
!==
"-"
)
{
dateValue
=
moment
(
options
.
date
)
dateValue
=
parseInt
(
dateValue
);
if
(
_
.
isNaN
(
dateValue
))
{
dateValue
=
options
.
date
;
}
dateValue
=
moment
(
dateValue
);
if
(
dateValue
.
_isValid
)
{
if
(
dateValue
.
_isValid
)
{
isValidDate
=
true
;
isValidDate
=
true
;
dateValue
=
dateValue
.
format
(
dateFormat
);
dateValue
=
dateValue
.
format
(
dateFormat
);
}
}
}
}
}
}
}
if
(
dateValue
!==
"-"
)
{
if
(
dateValue
!==
"-"
)
{
if
(
isValidDate
===
false
&&
options
&&
options
.
defaultDate
!==
false
)
{
if
(
isValidDate
===
false
&&
options
&&
options
.
defaultDate
!==
false
)
{
dateValue
=
moment
().
format
(
dateFormat
);
dateValue
=
moment
().
format
(
dateFormat
);
}
}
if
(
Globals
.
isDateTimeZone
)
{
if
(
!
options
||
options
&&
options
.
zone
!==
false
)
{
if
(
!
options
||
options
&&
options
.
zone
!==
false
)
{
dateValue
+=
" ("
+
moment
.
tz
(
moment
.
tz
.
guess
()).
zoneAbbr
()
+
")"
;
dateValue
+=
" ("
+
moment
.
tz
(
moment
.
tz
.
guess
()).
zoneAbbr
()
+
")"
;
}
}
}
}
}
return
dateValue
;
return
dateValue
;
}
}
return
Utils
;
return
Utils
;
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/audit/CreateAuditTableLayoutView.js
View file @
39892854
...
@@ -75,6 +75,13 @@ define(['require',
...
@@ -75,6 +75,13 @@ define(['require',
createTableWithValues
:
function
(
tableDetails
)
{
createTableWithValues
:
function
(
tableDetails
)
{
var
attrTable
=
CommonViewFunction
.
propertyTable
({
var
attrTable
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
scope
:
this
,
getValue
:
function
(
val
,
key
)
{
if
(
key
&&
key
.
toLowerCase
().
indexOf
(
"time"
)
>
0
)
{
return
Utils
.
formatDate
({
date
:
val
});
}
else
{
return
val
;
}
},
valueObject
:
tableDetails
valueObject
:
tableDetails
});
});
return
attrTable
;
return
attrTable
;
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/search/QueryBuilderView.js
View file @
39892854
...
@@ -359,8 +359,8 @@ define(['require',
...
@@ -359,8 +359,8 @@ define(['require',
}
}
obj
.
singleDatePicker
=
false
;
obj
.
singleDatePicker
=
false
;
}
else
{
}
else
{
obj
.
startDate
=
moment
(
valueObj
.
value
);
obj
.
startDate
=
moment
(
Date
.
parse
(
valueObj
.
value
)
);
obj
.
endDate
=
moment
(
valueObj
.
value
)
;
obj
.
endDate
=
obj
.
startDate
;
obj
.
singleDatePicker
=
true
;
obj
.
singleDatePicker
=
true
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/site/Statistics.js
View file @
39892854
...
@@ -398,7 +398,7 @@ define(['require',
...
@@ -398,7 +398,7 @@ define(['require',
if
(
type
==
'time'
)
{
if
(
type
==
'time'
)
{
return
Utils
.
millisecondsToTime
(
value
);
return
Utils
.
millisecondsToTime
(
value
);
}
else
if
(
type
==
'day'
)
{
}
else
if
(
type
==
'day'
)
{
return
Utils
.
formatDate
({
date
:
value
,
dateFormat
:
Globals
.
meridiemFormat
})
return
Utils
.
formatDate
({
date
:
value
})
}
else
if
(
type
==
'number'
)
{
}
else
if
(
type
==
'number'
)
{
return
_
.
numberFormatWithComma
(
value
);
return
_
.
numberFormatWithComma
(
value
);
}
else
if
(
type
==
'millisecond'
)
{
}
else
if
(
type
==
'millisecond'
)
{
...
...
This diff is collapsed.
Click to expand it.
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