Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. let dateObject;
  2.  
  3. // InitialCreationDateTime contains the DateTime object that I have received from the back-end
  4. if (this.initialCreationDateTime != null) {
  5. dateObject = new Date(this.initialCreationDateTime);
  6. } else {
  7. dateObject = new Date();
  8. }
  9.  
  10. // InitialCreationDateTime is nothing more then a string variable to store the final date string
  11. this.initialCreationDateTimeString = dateObject.getHours() + ':' + ((dateObject.getMinutes() < 10 ? '0' : '') + dateObject.getMinutes()) + 'xa0xa0' + dateObject.getDate() + '-' + (dateObject.getMonth() + 1) + '-' + dateObject.getFullYear();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement