-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
38 lines (34 loc) · 1.34 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var imgRef_01 = storageRef.child('data/photo_01.jpg');
var imgRef_02 = storageRef.child('data/photo_02.jpg');
firebase.auth().signInAnonymously().then(function () {
imgRef_01.getDownloadURL().then(function (url_01) {
document.getElementById('img_01').src = url_01;
}).catch(function (error) {
console.error(error);
});
imgRef_02.getDownloadURL().then(function (url_02) {
document.getElementById('img_02').src = url_02;
}).catch(function (error) {
console.error(error);
});
});
imgRef_01.getMetadata()
.then((metadata) => {
date = new Date(metadata.timeCreated);
var time_01 = (date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds());
var writtenDate_01 = (date.getDate() + '-' + (date.getMonth() + 1) + '-' + date.getFullYear());
document.getElementById("date-time_01").innerHTML = writtenDate_01 + " в " + time_01;
})
.catch((error) => {
console.error(error);
});
imgRef_02.getMetadata()
.then((metadata) => {
date = new Date(metadata.timeCreated);
var time_02 = (date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds());
var writtenDate_02 = (date.getDate() + '-' + (date.getMonth() + 1) + '-' + date.getFullYear());
document.getElementById("date-time_02").innerHTML = writtenDate_02 + " в " + time_02;
})
.catch((error) => {
console.error(error);
});