mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-29 08:29:54 +03:00
Use toLocaleString() instead of custom date format
This commit is contained in:
parent
246369fdec
commit
e3437daefe
1 changed files with 2 additions and 21 deletions
|
@ -56,27 +56,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
function modifySpecificAttributeTypes(value) {
|
function modifySpecificAttributeTypes(value) {
|
||||||
if (attribute === "created") {
|
if (attribute === "created") {
|
||||||
let date = new Date(value);
|
var date = new Date(value);
|
||||||
let year = date.getFullYear();
|
value = date.toLocaleString();
|
||||||
let month = date.getMonth();
|
|
||||||
let day = date.getDay();
|
|
||||||
let minutes = date.getMinutes();
|
|
||||||
let hours = date.getUTCHours();
|
|
||||||
let seconds = date.getSeconds();
|
|
||||||
let milliSeconds = date.getMilliseconds();
|
|
||||||
|
|
||||||
if (month < 10) {
|
|
||||||
month = '0' + month;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (minutes < 10) {
|
|
||||||
minutes = '0' + minutes;
|
|
||||||
}
|
|
||||||
if (hours < 10) {
|
|
||||||
hours = '0' + hours;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = day + "." + month + "." + year + " | " + hours + ":" + minutes + ":" + seconds + "." + milliSeconds;
|
|
||||||
} else if (attribute === "container_config" || attribute === "config") {
|
} else if (attribute === "container_config" || attribute === "config") {
|
||||||
value = "";
|
value = "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue