Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor / JS Dates

Tags:

date

time

meteor

So I am trying to make a timesheeting app in meteor, creating projects and adding time entries. Why? it was all I could think of as a test app.

But, I'm more used to dealing with PHP, in PHP I would just store a date field with a time length. Right now, I'm wondering what's the best wat to deal with dates in Meteor.

Do… I do the same thing where I store a parsed string of the date, or is it a date time object? How would you deal with dates? (I'm only 3 hours into Meteor)

like image 941
rjksn Avatar asked Dec 11 '22 14:12

rjksn


1 Answers

Meteor also includes the momentjs library which makes dealing with dates and times very easy. You get function to format and parse.

The best way to store your time is in a Date object. This is because in Mongo you will get the timestamp and its GMT deviation. Making the time TimeZone secure.

In order to manipulate and display times, use momentjs.

like image 92
Micha Roon Avatar answered Jan 16 '23 09:01

Micha Roon