mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-28 16:09: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) {
|
||||
if (attribute === "created") {
|
||||
let date = new Date(value);
|
||||
let year = date.getFullYear();
|
||||
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;
|
||||
var date = new Date(value);
|
||||
value = date.toLocaleString();
|
||||
} else if (attribute === "container_config" || attribute === "config") {
|
||||
value = "";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue