Could someone list the pros and cons of using one over the other. (www.datejs.com vs. https://github.com/jquery/globalize). All I knew is Jquery/globalize supports more culture than datejs.
You can use both of them together. DateJS makes it much more convenient to do math on date objects, and also provides some functionality for displaying dates. Globalize provides functionality for displaying dates for different cultures.
If you need to do math on dates and to display internationalized dates, use both. Have Globalize display dates that are calculated with DateJS.
If you just need to do math on dates and display dates in a format readable by most Internet users, use DateJS.
If you don't need to do math on dates (it might be that the server and APIs take care of it), but need to display internationalized dates, use Globalize.
Globalize supports more than just Date/Time formatting and Parsing (different Calendar systems with automatic conversion in the related field, number, currency, percentage formatting, translating strings, checking if given language is written Right-To-Left). It is fairly well-written and supports more than 350 culture. The project is quite active.
DateJS supports less cultures and only Date/Time formatting, parsing and manipulating as well as time zones conversion (unsupported by Globalize). The project is less active and the last snapshot is rather old (and marked as Alpha version). It seems like Joda Time equivalent for JavaScript and it really seems nice, but...
Fortunately, as Ben said you can combine them together.
Related
I'm building a WordPress based site and the plugin that delivers the core-functionality doesn't allow changing the date format via the translation files.
All dates are giving out in an American format ("03-24-2017") and I would like to display them in a European format instead ("24.03.2017").
What would be the most straightforward and efficient way to do this? I googled the problem and found several JS-based libraries, but many of them seem to be to expansive (i.e. they also transform things like temperature, etc.). What I'm looking for is a straightforward solution that just formats the date and doesn't come with too much other technical hangover.
The straight forward way id, Go to Admin Panel, Open Settings, you can check Time Format
Choose Custom and add m.d.Y format.
I have a multi tenant asp.net application. In it each user can set their timezone. However often users log in from browsers where the timezone is different to the preference they have set in my asp.net solution. I want to know, the best practise, should I always force the user to change his computer's timezone to that of his preference in my asp.net application
OR
Should I not bother and let him be in whichever timezone he is in? Any advice on the best practise or convention on how the big sites such as salesforce and others operate will be very helpful.
Tx
IMHO, you can save user preferences like timezone and show in the UI. If the user has no preference, use the UI culture to format the data for display in the UI.
Always store date times in db as UTC format and show in the UI based on the configuration or the current locale.
The JavaScript datetime formats are different from the C# formatting.
Please refer
https://msdn.microsoft.com/en-us/library/ff743760(v=vs.94).aspx
And, http://googleweblight.com/?lite_url=https://stackoverflow.com/questions/22096571/explanation-for-timespan-differences-between-c-sharp-and-javascript&ei=30ovNWzN&lc=en-IN&s=1&m=918&host=www.google.co.in&ts=1485879489&sig=AF9NedmhETXDK0ppwa-fSly3Hmy58wdNaw
HTH
I read some articles regarding web applications which depend on the date and time and geographical position.
I am interested in finding here a few best practices and even solutions for java web applications which client side happens to be on Angular.
I am looking for the best way to store the dates and times in my database so that I can determine their values based on user's location. We have some help here from the Javascript side which can determine the user's timezone.
Any advices, best practices and solution would be great.
I want to know from your experience what is the best way to do this thing because each article I read had a slightly different solution and that small diference caused iasuea later.
You may want to check out Moment.js, and specifically the Timezone add-on if you haven't already... it will take ISO 8601 datetime formatted string by default, the industry standard on any platform.
The Timezone is useful in dealing with timezones and converting between them etc.
This format encodes the UTC time with a timezone part, with high precision.
I was reading the manual of a plugin here and at one point it was written:
External plugins like the jQuery UI datepicker have to be localized separately in their own way
What does that mean?
Localization is a broad topic and covers many areas such as writing direction, character encoding, currency, time zones and many many more. But here the sentence is referring to the date picker feature of jQuery and it means if you are developing an app for Chinese audiences or any other culture that uses different kind of calendar you have to change the datepicker yourself and this plugin doesn't do it automatically.
Localization involves taking source content and making it relavant for a local market - this includes translation, number formatting (1,000 vs 1.000), date formatting (03/18/2014 vs 18/03/2014), calendar display (Sunday - Saturday vs. Monday - Sunday), currency, and really anything that would make the content most applicable to a local market.
I was wondering if anyone could point to an Open Source date utility class that is fairly robust. I find myself rolling my own when I want to do a lot of things I take for granted in C# and Java. For instance I did find a decent example of a DateDiff() function that I tore apart and another DatePart() function. Another examples would be parsing different date/time formats. I'm trying to avoid reinventing something if it's already built.
Another possibility may be a nice set of Javascript files that I can convert to ActionScript 3. So far I've found DateJS but I want to get a good idea of what is out there.
as3corelib has the DateUtil class and it should be pretty reliable since it's written by some Adobe employees. I haven't encountered any problems with it.
There is also DP_DateExtensions, though I believe DateJS is more robust.