finally workig timestamp
This commit is contained in:
parent
13b31b50f7
commit
e8209c511f
@ -1,11 +1,12 @@
|
||||
|
||||
var add = function() {
|
||||
let millis = Date.parse($('#published')[0].value)
|
||||
db.collection("bibliotek").add({
|
||||
tittel: $('#title')[0].value,
|
||||
forfatter: $('#author')[0].value,
|
||||
forlag: $('#publisher')[0].value,
|
||||
terningkast: $('#rating')[0].value,
|
||||
utgitt: new firebase.firestore.Timestamp(Date.parse(Date($('#published')[0].value))/1000, 0)
|
||||
utgitt: new firebase.firestore.Timestamp(millis/1000, 0)
|
||||
}).then(function() {
|
||||
$('#status').html('<p style="color: green;">La til bok '+$('#title')[0].value+'!</p>')
|
||||
}).catch(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user