Update jquery.dateFormat-1.0.js #31

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants

TTo314 commented Oct 30, 2012

Added format date case 5, for 'Oct 30, 2012 10:04:00 AM', and hour meridian

Update jquery.dateFormat-1.0.js
Added format date case 5, for 'Oct 30, 2012 10:04:00 AM', and hour meridian
Owner

phstc commented Nov 2, 2012

Hey @TTo314, tks for the PR.

Could you add tests Test.html for this new format?

Cheers,
Pablo Cantero

TTo314 commented Dec 17, 2012

Ya esta añadido. Perdona, me confundí y abrí otro branch.

Un saludo,
Alberto

@@ -52,6 +58,10 @@
hour = values3[0];
minute = values3[1];
second = values3[2];
+
+ if (hour == 12 && pm[meridian]);
@phstc

phstc Dec 21, 2012

Owner

Is this if necessary? it seems to be doing nothing.

@TTo314

TTo314 Dec 21, 2012

Good morning,

  • if (hour == 12 && pm[meridian]);
  • else if (hour == 12) hour = '00';
  • else if (pm[meridian]) hour = parseInt(hour) + 12;

-If it is meridian and 15PM, will it increment 12?

Hours has a range of 1-12.

-Is this if necessary? it seems to be doing nothing.

Starting from the end, If hour is PM, hour + 12 (1=13, 2=14...). If
hour is 12 and not PM is 00. And default havent update.

  • var pm = [];
    
  • pm["PM"] = true;
    
  • pm["pm"] = true;
    
  • pm["p.m."] = true;
    
  • pm["P.M."] = true;
    

-Do these formats exist p.m. and P.M.?

Everything is possible in spanish.

Excuse my english, bye.

2012/12/21 Pablo Cantero notifications@github.com

In jquery.dateFormat-1.0.js:

@@ -52,6 +58,10 @@
hour = values3[0];
minute = values3[1];
second = values3[2];
+

  •                if (hour == 12 && pm[meridian]);
    

Is this if necessary? it seems to be doing nothing.


Reply to this email directly or view it on GitHubhttps://github.com/phstc/jquery-dateFormat/pull/31/files#r2484758.

+
+ if (hour == 12 && pm[meridian]);
+ else if (hour == 12) hour = '00';
+ else if (pm[meridian]) hour = parseInt(hour) + 12;
@phstc

phstc Dec 21, 2012

Owner

I will be honest, these conditions are confuse to me. For all hour == 12, will it change to 00?

else if (pm[meridian]) hour = parseInt(hour) + 12;
If it is meridian and 15PM, will it increment 12?

@TTo314

TTo314 Apr 9, 2013

For all hour == 12, will it change to 00?
No. if hour == 12 and pm[meridian], it do nothing.

If it is meridian and 15PM, will it increment 12?
If it is meridian and 3PM, it increment 12, equals 15 hours without PM.

//IF POSITIVE
if (hour == 12 && pm[meridian]);
else if (hour == 12) hour = '00';
else if (pm[meridian]) hour = parseInt(hour) + 12;

OR

//IF NEGATIVE
if (pm[meridian] && hour != 12) parseInt(hour) + 12;
else if (hour == 12 && pm[meridian] == 'undefined') hour = '00';

+ pm["pm"] = true;
+ pm["p.m."] = true;
+ pm["P.M."] = true;
+
@phstc

phstc Dec 21, 2012

Owner

Do these formats exist p.m. and P.M.?

Owner

phstc commented Dec 21, 2012

Hey Alberto, thanks a lot for the contribution. I made few comments in your code, could you check it again?

@phstc phstc closed this Apr 6, 2013

@TTo314 TTo314 deleted the TTo314:patch-1 branch Jun 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment