GithubHelp home page GithubHelp logo

datejs's People

Watchers

 avatar

datejs's Issues

[FIXED] Parsing DayName only always return 'today'

If you parse just a valid day name (friday, monday, etc), the parser always
returns today's date. 

Date.parse('friday') // returns today
Date.parse('monday') // returns today


Parsing month names works as expected. 

Date.parse('march')  // returns 1st of March

Original issue reported on code.google.com by geoff%[email protected] on 13 Nov 2007 at 8:54

[FIXED] toString hour field fails for 12am

What steps will reproduce the problem?
1. Open console window
2  new Date(2007,11,16,0,51,53).toString("MMMM dd, yyyy - hh:mm tt")


What is the expected output? What do you see instead?
I see "December 16, 2007 - 00:51 AM"
I expect "December 16, 2007 - 12:51 AM"

What version of the product are you using? On what operating system?
Alpha1. All browsers produce the same. 

Please provide any additional information below.
To fix this, go to line core-debug.js line 604 - 602

Change it to 
        case "hh":
            return p(self.getHours() < 13 ? (self.getHours() == 0 ? 12 : self.getHours()) : 
(self.getHours() - 12));
        case "h":
            return self.getHours() < 13 ? (self.getHours() == 0 ? 12 : self.getHours()) : (self.getHours() 
- 12);

I've attached a fixed version of latest_alpha1. It includes a unit test to 
diagnose and fix the 
problem.

Thanks

Original issue reported on code.google.com by [email protected] on 22 Dec 2007 at 12:59

Attachments:

[FIXED] next wed at 4pm

LOVE YOUR WORK.

Date.parse('next wed at 4PM') returns:
Wed Jan 23 2008 04:00:00 GMT+1100 (EST)

The work around is:
Date.parse('next wed at 16PM')

Incidently Date.parse('next wed at 16AM'): (NOTE AM) returns
Wed Jan 23 2008 16:00:00 GMT+1100 (EST)

All tests were run using [date-en-AU.js]

Original issue reported on code.google.com by [email protected] on 17 Jan 2008 at 9:13

[INVALID] European date formats

What steps will reproduce the problem?
1. Type in 05/11/07 to the test textbox
2.
3.

What is the expected output? What do you see instead?
In the USA you would expect to see this resolved as 11th May (which is what
is displayed) but in Europe you would expect to see 5th November.

If you type in 23/11/07 this is correctly interpreted as 23rd November - so
where there is no ambiguity - there is no problem.

Would it be possible to use system information from the browser to correct
this?


What version of the product are you using? On what operating system?
Current test screen running in up to date FireFox

Please provide any additional information below.

Otherwise it all looks brilliant

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 4:21

[FEATURE REQUEST] "12:00am" indistinguishable from "time of day not specified"

More of a feature request than a bug, but quite an important one I feel.

It's important for us to be able to distinguish between a situation where
only a date is entered, and no precise time (eg 'Tuesday'), and a situation
where both a date and a precise time is entered ('Tuesday 12:00am').

While we can just check for 12:00am and treat it at 'time not entered',
sometimes our users do enter this as a precise time for an event.

Original issue reported on code.google.com by [email protected] on 14 Feb 2008 at 5:50

date.parse( "3pm tomorrow" ) returns the date of tomorrow, 12:00:00 AM.

What steps will reproduce the problem?

date.parse( "3pm tomorrow" ) // Done on 9/12/2008.


What is the expected output? What do you see instead?

Expected: Saturday, September 13, 2008 03:00:00 PM
Actual:   Saturday, September 13, 2008 12:00:00 AM
In other words, it's not bothering with the time portion of the english phrase.


What version of the product are you using? On what operating system?
FF3 / Windows XP.

Original issue reported on code.google.com by [email protected] on 12 Sep 2008 at 2:57

Date.parse() works differently on different browsers

What steps will reproduce the problem?
1. Open your homepage in IE7 and Firefox2 on a thur, fri or sat
2. Type 'wednesday' in Mad Skillz.. demo box
3. IE7 shows May 14, Firefox show May 7.

Same issue for 'today', 'sun.. sat', 'last ...', etc.

Safari works like Firefox. I don't know about IE6 yet.

What is the expected output? What do you see instead?
The same date on all browsers. Different dates depending on the browser.

What version of the product are you using? On what operating system?
 * Version: 1.0 Alpha-1 
 * Build Date: 13-Nov-2007


Original issue reported on code.google.com by [email protected] on 11 May 2008 at 2:58

Parsing errors for 12am/pm

File date-en-US.js version 1.0 alpha 1.

Parsing a date string of "12 am" returns 12pm.
Parsing a date string of "12 pm" results in an error.

Original issue reported on code.google.com by [email protected] on 7 Sep 2008 at 1:05

[FIXED] Problem with german month parsing

What steps will reproduce the problem?
1. Try to parse 'Dez' (december), or 'Okt' (October) with german globalization.

What is the expected output? What do you see instead?
I couldn't get some month to parse. 


What version of the product are you using? On what operating system?
Using latest version of trunk.

See attached test cases.


Original issue reported on code.google.com by [email protected] on 4 Apr 2008 at 9:43

Attachments:

[FIXED] Weird parser bug

"2 week t" returns "+2week"; "2 week" returns "today"

What version of the product are you using? On what operating system?
Firefox 2, OS X 10.5.1

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 8:39

Issue with French Translations

What steps will reproduce the problem?
1. Use the French localization
2. Various shorthands do not work, some translations are not done.
3.

What is the expected output? What do you see instead?
I expect to get the full date form of the shorthand entered, I do not get
anything.

What version of the product are you using? On what operating system?
the latest version, operating system independent.

Please provide any additional information below.
The attached file resolves the issue.

Original issue reported on code.google.com by [email protected] on 8 Sep 2008 at 2:28

Attachments:

0:00am == 0:00pm

What steps will reproduce the problem?
var d1 = Date.parse("0:00am");
var d2 = Date.parse("0:00pm");
if(d1.getTime() == d2.getTime()) {
  alert("This shouldn't be");
}

What is the expected output? What do you see instead?
Either:
 * 0:00pm and 0:00am are rejected, or
 * 0:00am == 12:00am and 0:00pm == 12:00pm.

What version of the product are you using? On what operating system?
Using date-en-AU.js from SVN (r130) in Firefox 2.0.0.11 on Mac OS X 10.5.1

Please provide any additional information below.
I'm happy to be corrected on what 0:00am and 0:00pm mean, but it struck me as 
odd that these 
times were accepted.

Original issue reported on code.google.com by craig.e.anderson on 24 Jan 2008 at 6:07

[FIXED/FUTURE] isDST() broken

*******************************************************

This issue originated as post in the Datejs forums. See
http://tinyurl.com/2sznas

The issue has been moved here to track it's status. 

*******************************************************

Using version 1.0 Alpha-1 the following code:

  alert( new Date().isDST() );

gives the following error in the Firebug console:

 this.toString().match(/(E|C|M|P)(S|D)T/) has no properties

The above code seems to assume that Date.toString() returns a string
that includes a time zone, and that it matches the regular
expression.

Looking at that particular function:

  Date.prototype.isDST = function () {
    console.log('isDST');
    /* TODO: not sure if this is portable ... get from
Date.CultureInfo? */
    return this.toString().match(/(E|C|M|P)(S|D)T/)[2] == "D";
  };

The value returned by match(...) should be tested to see if a second
element exists before attempting the evaluation.  It also seems to be
a very weak test of whether or not daylight saving is in force (or at
least whether the system executing the code thinks daylight saving is
being observed).

The notes in the code show doubt about the usefulness of the function
- does the CultureInfo section need to define every time zone in the
world, and identify which ones are DST and which aren't?

There is a useful list of time zone abbreviations here:

<URL; http://www.worldtimezone.com/wtz-names/timezonenames.html >

but I have no idea how authoritative they are - as far as I know,
there is no standard for them.

-- 
Rob 



Original issue reported on code.google.com by geoff%[email protected] on 19 Dec 2007 at 7:56

[INVALID] Parse issue

Date.parse("2008/03/11 5:17:00 -0800")
Tue Mar 11 2008 06:17:00 GMT-0700 (PDT) _orient=1 _is=false

Why does it return back 6:17 AM?

Original issue reported on code.google.com by eggie5 on 11 Mar 2008 at 10:46

Date.parse('+100') fails

The parser does not accept 3 (or more) character math numbers.

Example

Date.parse('+100'); // fail


Original issue reported on code.google.com by geoff%[email protected] on 29 Nov 2007 at 12:22

[FIXED] 's' is undefined in Parser Exception when non-parsable string is passed to .parse()

What steps will reproduce the problem?
1. Run the following in Firebug, <code>Date.parse('asdf')</code>
2. Firebug jumps into debugger and shows variable 's' as undefined.


A return value of Null is expected when the supplied string cannot be
parsed into a Date object.

Test available online at http://www.datejs.com/test/core/. Must be using
FireFox.

Error happens on any parse failure.

Example

Date.parse()
Date.parse('')
Date.parse('asdf')
Date.parse(null)

Original issue reported on code.google.com by geoff%[email protected] on 12 Nov 2007 at 2:01

[FIXED] this.message & 's' are 'undefined' with unparsable string

Within Firebug, "Break on All Errors" must be enabled. 

Within Firebug try the following...

    Date.parse('asdf')

Firebug jumps into the debugger and returns this.message and 's' as undefined. 

Line 11:
Exception: function(s) { 
    this.message = "Parse error at '" + s.substring(0,10) + " ...'"; 
}

[FIXED] Returned null within Parser.finish if the Array length is 0.

Original issue reported on code.google.com by geoff%[email protected] on 12 Nov 2007 at 2:03

"yesterday week" returns equivalent to "next week"

Date.parse("yesterday week").equals(Date.parse("next week")); //
[PASS]which is not good

The following should pass...
Date.parse("yesterday week").equals(Date.parse("next week").add(-1).day());
// currently fails

This is a bit of known issue when combining Relative dates ("tomorrow")
with date math ("+week"). One hand is not talking to the other.

A fix is planned and should be available in the next release (Beta 1) of
the Parser.

Original issue reported on code.google.com by geoff%[email protected] on 27 Nov 2007 at 10:36

[FIXED] Wrong parsing result

What steps will reproduce the problem?
1. Type "december 9 at 9am"

What is the expected output? What do you see instead?
You will see: Saturday, December 01, 2007 9:00:00 AM
Should be: Sunday, December 09, 2007 9:00:00 AM

What version of the product are you using? On what operating system?
Alpha 1. Firefox

Please provide any additional information below.
Otherwise -- great script! Thanks

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 2:19

Unable to parseExact a string in a certain format

I commented here - http://code.google.com/p/datejs/wiki/FormatSpecifiers - but 
realized that 
may not have been the right place.

I'm trying to parseExact a date string like "yyyy-MM-ddTHH:mm:ss.000-05:00" but 
the latter part 
(-05:00) breaks if it's a different time zone (-06:00) is present. I've tried 
using "P" (noted above) but 
no joy. I'm using trunk. I can't change the format... google calendar RSS. :)

I've also tried using just "c", but the presence of milliseconds in the string 
breaks it.

Anything I can try?

Original issue reported on code.google.com by [email protected] on 24 May 2008 at 3:30

[FIXED] "day after tomorrow" returns "tomorrow"

What steps will reproduce the problem?
1. type "day after tomorrow"

What is the expected output? What do you see instead?
Expect equivalent to "+2 days"; get equivalent of "+1 day"

What version of the product are you using? On what operating system?
Firefox 2, OS X 10.5.1

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 8:33

[FIXED] twoDigitYearMax is now a four digit number in CultureInfo file

I think there is a logic error in the parser with two digit years. 

The CultureInfo.twoDigitYearMax will return a four digit year. The year
Translator will always return true. 

year: function(s) {
return function() {
  var n = Number(s);
  this.year = (( s.length > 2 ) ? n : 
      (n + ( ( n < Date.CultureInfo.twoDigitYearMax ) ? 2000 : 1900 )));      
};
},

Original issue reported on code.google.com by geoff%[email protected] on 12 Nov 2007 at 2:00

[INVALID] Behaviour when typing a day name on its own is ambiguous

Specifying "next [some day]" or "last [some day]" behaves as expected, but
specifying "[some day]" on it's own gives you the *nearest* [some day], so
the behaviour will vary depending on the day of the week.  (Typing "monday"
today gives me "last monday", but typing "monday" on Friday will give me
"next monday".)

What is the expected output? What do you see instead?
Personally, I'd expect it to always default to "next [some day]", but that
relies on local convention -- for other people "nearest [some day]" or"last
[some day]" may be the expected behaviour.  (I trust you realise that a
*huge* subset of this problem area requires strong AI? :)

What version of the product are you using? On what operating system?
Firefox 2, OS X 10.5.1

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 8:45

"monday +2week" equivalent to "+2days"

What steps will reproduce the problem?
1. Type "monday +2week"

What is the expected output? What do you see instead?
Expected output: ideally, two weeks from the following monday (although
given a previous issue I've raised, even "monday" or "+2week" would be
*more* expected; "+2 days" is just bizarre.

What version of the product are you using? On what operating system?
Firefox 2, OS X 10.5.1

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 8:35

Parsed string to date rendered inconsistently by toString() in some browsers

I'm parsing dates from "yyyy-MM-ddTHH:mm:ss-05:00" format and then 
toString()'ing them.

I'm being told that some folks were seeing strange dates as a result, so I 
fired up Parallels and 
MSIE6 and sure enough, they we weird. Hours off.

I checked the system time and *it* was way off. Set it. Quit and re-opened MSIE 
and all was well.

So I can envision a way to say "hey, buddy, your clock's off, so these dates 
might be too," but 
what's bugging me is why is it that a specific date being read in and then 
printed out is affected 
by the system's time settings?

Is there a way to override this? Maybe some kind of Date.setBaseTime() or 
Date.setTimeZone()?

You may or may not be able to see this in action here...
  http://www.redeemerbaptist.org/

...using a WordPress plug-in I'm attempting to make here...
  http://code.google.com/p/wp-gcal-rss/

Whining aside, thanks for a great tool!

Original issue reported on code.google.com by [email protected] on 4 Jun 2008 at 1:20

[FIXED] getWeekOfYear is buggy and does not conform to ISO 8601:1988 (for locales using that flavor)

Iterating from 1 st of january with monday as start of week will
give buggy results (0, 52, 1, 2, 3) and weeks will be one off from 
the ISO version. 

  dateiterator = new Date(2008,01-1,01);
  end   = new Date(2008,05-1,31);
  while (dateiterator < end)
  {
    alert(dateiterator + '\n' + dateiterator.getWeekOfYear());
    dateiterator.moveToDayOfWeek(1);
    i++;
  }

Definition: A week is identified by its number in a given year. A week
begins with a Monday, and the first week of a year is the one which
includes the first Thursday, or equivalently the one which includes January 4. 

Original issue reported on code.google.com by [email protected] on 27 Feb 2008 at 9:19

[FIXED] Parse 'jan 2008' doesn't return 1/1/2008

What steps will reproduce the problem?
1. Parse a date like 'jan 2008' or '1 2008'
2.
3.

What is the expected output? What do you see instead?
The expected output would be january 1, 2008. the actual result is january
27 2008. The day number is incorrect, it uses the day number of the actual
date.

What version of the product are you using? On what operating system?
1.0 alpha 1, 24th March 2008

Please provide any additional information below.
All other months return the correct result. It is just January that returns
the current day number rather than the 1st. The same error occurred for any
year I tried.


Original issue reported on code.google.com by [email protected] on 27 Mar 2008 at 9:00

[FIXED] No RangeError if "day out of range"

Example: Date.parse('31')

If month does not have 31 days, the Parser is correcting to the last day of
the month. A RangeError should be thrown.  

See /test/partial/.

The core throws a RangeError.

Example:

try { 
    new Date(2007, 10, 5).set( { day: 31 } ) 
} 
catch(ex) { 
    console.log(ex) 
}

[FIXED] Moved Type checking and RangeError checks into validate*() functions. 

Reworked .add() and .set() functions. There were problems with '0' being
dealt with as a null value.

Original issue reported on code.google.com by geoff%[email protected] on 12 Nov 2007 at 2:02

Order of formats in Date.parseExact()?

Seems to be a problem in .parseExact() somewhere, or maybe it's in
Parser.finishExact. For example...

// returns null
Date.parseExact("November 2007", ["MMMM d", "MMMM yyyy"]);

// Switch the format order, and a valid date is returned
Date.parseExact("November 2007", ["MMMM yyyy", "MMMM d"]);

Original issue reported on code.google.com by geoff%[email protected] on 26 Nov 2007 at 6:10

[INVALID] Parsing problem with GMT/UTC Date Times

What steps will reproduce the problem?
1. set timezone to middle east
2. Date.parse( "02/19/2008 6:00 PM GMT" )
3. Date.toString( "MM/dd/yyyy HH:mm:ss tt" ) returns "02/01/2008 8:00 PM"

What is the expected output? What do you see instead?
"02/19/2008 8:00 PM"

What version of the product are you using? On what operating system?
version: 1.0 Alpha-1, Windows US

Original issue reported on code.google.com by [email protected] on 13 Feb 2008 at 4:54

[FIXED] Stub out other CultureInfo files

Provide base CultureInfo file for all cultures.

At least 150+ individual cultures will be provided.

Some of the CultureInfo.regexPatterns section will have to be customized by
hand for each culture.

Original issue reported on code.google.com by geoff%[email protected] on 12 Nov 2007 at 2:04

formatPatterns usage not updated

In file date-en-US.js, version 1.0 alpha 1.

I see that formatPatterns was created a a sub-array of CultureInfo, and
each pattern had the "pattern" suffix removed. References to those patterns
were updated to CultureInfo.formatPatters however the "pattern" suffixes
remain.

Original issue reported on code.google.com by [email protected] on 7 Sep 2008 at 1:00

Date additions unreliable in Safari 2

Safari 2's implementation of Date#setDate uses a signed byte integer which
means large values will get 'rolled over' and return an incorrect value
unless the add/subtracts are called in increments. The following link
details this bug which affects the addition methods that use setDate. This
issue does not affect Safari 3.

http://brianary.blogspot.com/2006/03/safari-date-bug.html

I tested using the version installed at http://www.datejs.com/

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 2:59

[FIXED] toShortDateString, toShortTimeString etc do not work - spelling

What steps will reproduce the problem?
1. Create a new date var d = new Date().today();
2. alert(d.toShortTimeString())

What is the expected output? What do you see instead?

Expected: 6/19/2017
See: Mon Jun 19 2017 00:00:00 GMT+0100 (GMT Daylight Time)

What version of the product are you using? On what operating system?

Alpha1

Please provide any additional information below.

All these methods do not work because they have the formatPatterns.xxx
option spelt incorrectly. Example

return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern);

should be 

return this.toString(Date.CultureInfo.formatPatterns.shortDate);

Original issue reported on code.google.com by [email protected] on 20 Apr 2008 at 9:01

[FIXED] TimePeriod for two dates is broken

What steps will reproduce the problem?
1. Create a new TimePeriod object for two dates
2. var foo = TimePeriod(Date.today(), Date.today());


What is the expected output? What do you see instead?
expected: foo should be an object
actual: the error d1.getDaysInMonth() is not a function

What version of the product are you using? On what operating system?
Latest SVN nightly (as of May 7th, 2008)

Please provide any additional information below.
The problem is that lines 245 and 251 of time.js are using:
d1.getDaysInMonth()

However, getDaysInMonth is a static function, not an instance method. 

Changing the line:
 d1.getDaysInMonth() to
 Date.getDaysInMonth(d1.getYear(), d1.getMonth())

fixes the problem

Original issue reported on code.google.com by [email protected] on 7 May 2008 at 5:04

13:00am and 13:00pm allowed?

What steps will reproduce the problem?

var d = Date.pase("13:00am");
// d should be null, but is 1:00pm.

What is the expected output? What do you see instead?
d should be 1:00pm.

What version of the product are you using? On what operating system?
Using date-en-AU.js from SVN (r130) in Firefox 2.0.0.11 on Mac OS X 10.5.1

Please provide any additional information below.


Original issue reported on code.google.com by craig.e.anderson on 24 Jan 2008 at 6:32

[FIXED] "saturday" returns Thursday Nov 1st.

What steps will reproduce the problem?
1. Type "saturday"

What is the expected output? What do you see instead?
Expected: A similar result to "monday", "friday", etc.

What version of the product are you using? On what operating system?
Firefox 2, OS X 10.5.1

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 8:40

[FIXED] getTimezone

What steps will reproduce the problem?
1. Type in Date.today().getTimezone()
2. Returns null instead of "PST"

What is the expected output? What do you see instead?
It should say "PST" for my specific timezone. It always returns null though
with whatever date I give it.

What version of the product are you using? On what operating system?
Alpha-1. Using Firefox 2.0.0.11 on Mac OS X Leopard. Same problem in Safari
3.0.

Original issue reported on code.google.com by [email protected] on 3 Dec 2007 at 5:25

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.