Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moment.js
Message
 
 
À
13/05/2017 04:11:32
Information générale
Forum:
Javascript
Catégorie:
Autre
Titre:
Divers
Thread ID:
01651078
Message ID:
01651088
Vues:
58
>Where did you get that syntax from? There is no moment function that takes a date and a string - it's either a date OR a string (with an optional second string to inform on the format of the date in the first string). IAC all you need is :
$scope.currentData.age = moment().diff(newValue,"years");
Read the docs: https://momentjs.com/docs/

I don't know who wrote that syntax, but I did figure out exactly that on my own and I did read the docs (that's how I figured the needed change).
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform