Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Lowercase meridian indicator #10

Closed
brandonweiss opened this issue Aug 11, 2013 · 9 comments
Closed

Lowercase meridian indicator #10

brandonweiss opened this issue Aug 11, 2013 · 9 comments

Comments

@brandonweiss
Copy link

It would be great to be able to get am/pm in lowercase.

@GregDThomas
Copy link
Owner

Agreed. We could use tt for am/pm and TT for AM/PM. I'll get this done shortly.

@brandonweiss
Copy link
Author

Thanks!

@GregDThomas
Copy link
Owner

Fixed in 0.8.0 (sorry for the delay!)

@BryanKelly
Copy link

Not sure if this matters to anyone else or not, but this breaks compatibility with .NET custom date formatting.

http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx

.NET doesn't actually have a difference between upper and lower case in the format string.

Having said this I'm sure I can work around this. Just wanted to make a note of it.

@BryanKelly
Copy link

Maybe the better way to do this would be a setting for the AM/PM designator. That way tt just refers to the desginator.

@brandonweiss
Copy link
Author

I'm not sure I understand...why would that matter? What does a JavaScript library have to do with .NET? There is (unfortunately) no standard for the tokens in date/time formatting across programming languages and libraries. There are often some similarities for common tokens, as many implementations are initially based off of one another, but they inevitably diverge because a language or library forgot or intentionally chose not to implement some feature, so that token just gets made up on the spot when it is implemented.

You shouldn't have to work around anything. You just use the proper tokens for .NET when dealing with .NET date/time formatting, and you use the proper tokens for jquery-localtime when dealing with jquery-localtime.

@BryanKelly
Copy link

I have an MVC project. We have this line that sets the format for jQuery localtime to use:

$.localtime.setFormat('@String.Format("{0} {1}", System.Globalization.DateTimeFormatInfo.CurrentInfo.ShortDatePattern, System.Globalization.DateTimeFormatInfo.CurrentInfo.LongTimePattern)');

In en-US, LongTimePattern uses tt which is where my problem is here. That is where my work around comes from. I will have to write a method that can convert from .NET date/time formatting -> jquery-localtime.

@GregDThomas
Copy link
Owner

Yes; unfortunately you'll need a conversion method. Ultimately, the server-side could be .NET or Java or Ruby or etc. etc. etc. It's not practical for jQuery localtime to support all of these - they are probably self-contradictory, so you'd need $.localtime.setFormatInCLRStyle() and $.localtime.setFormatInJavaStyle() and so on. In an ideal world, I'd like the plugin to support globalize (see issue #2 and https://github.com/jquery/globalize) to avoid the current English hard-coding of "January", "Monday", etc. but that plugin is still in Alpha. When it's more stable, expect to see the formatting support whatever that globalize plugin ends up with.

@BryanKelly
Copy link

I totally get that you wouldn't want to support all those formats. My comment was more of a note to other .NET developers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants