components icon indicating copy to clipboard operation
components copied to clipboard

Datepicker calendar breaks down in firefox

Open zggb opened this issue 9 years ago • 13 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Datepicker calendar should works in firefox with all years.

What is the current behavior?

Datepicker calendar breaks near 1985 year

What are the steps to reproduce?

  1. go to the https://material.angular.io/components/datepicker/examples in firefox and open browser console
  2. choose 1984 year in basic datepicker
  3. you will see ERROR Error: Invalid date "1" for month with index "3". in console

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

firefox 56.0.2 (64-bit) material and angular on https://material.angular.io/components/datepicker/examples also it reproduces locally with:

  • angular 4.3.1
  • @angular/material": "^2.0.0-beta.10" and "@angular/material": "^2.0.0-beta.8", cleanagedeidolonhelvum-size_restricted
screen shot 2017-11-08 at 16 01 27

zggb avatar Nov 08 '17 14:11 zggb

My issue is similar to yours. https://github.com/angular/material2/issues/8295

echosalik avatar Nov 08 '17 15:11 echosalik

I'm not able to reproduce this in firefox 57, will download 56 and give it a shot

mmalerba avatar Nov 17 '17 00:11 mmalerba

Just tried with firefox 56.0.2 on mac and not able to reproduce there either. @zggb is this still happening for you?

mmalerba avatar Nov 21 '17 19:11 mmalerba

yes, still the same behavior in the Firefox 57.0.2

Yo don't need to choose exactly 1985, just open basic datepicker, switch to the year choosing, and decrease year by left arrow. Between 1075-1985 you will see this

screen shot 2017-12-06 at 13 57 16

zggb avatar Dec 06 '17 11:12 zggb

I opened the calendar at 2017 and went all the way back to year 1 but did not encounter this issue. Couple ideas though:

  • Have you tried clearing your cache? maybe you have an old version of the docs site with a bug in it.
  • May I ask what timezone your machine is set to? it may be a timezone-specific issue

mmalerba avatar Dec 06 '17 16:12 mmalerba

yes, I delete cache, use different firefox (dev edition), but still the same my zone is UTC+02:00. Kiev

screen shot 2017-12-08 at 14 10 34 screen shot 2017-12-08 at 14 10 11

zggb avatar Dec 08 '17 12:12 zggb

I believe this is the same issue as #8295 I believe it only affects the NativeDateAdapter so if you're able to use the MomentDateAdapter that should solve the problem in the mean time

mmalerba avatar Dec 08 '17 15:12 mmalerba

I'll use #8295 to track this issue, so closing this one

mmalerba avatar Dec 08 '17 15:12 mmalerba

with MomentDateAdapter works fine, thank you @mmalerba

zggb avatar Dec 14 '17 12:12 zggb

Um... can someone help me with moment date adapter? Like how to import it? I can find it.

echosalik avatar Dec 15 '17 05:12 echosalik

@DragoTechInnovations Follow these steps to get a moment date adapter:

  1. Install @angular/material-moment-adapter from npm:
    npm install @angular/material-moment-adapter --save
    
  2. Import MatMomentDateModule from @angular/material-moment-adapter and place it in your imports array in your app's module:
    import { MatMomentDateModule } from '@angular/material-moment-adapter';
    // ...
    @NgModule({
        imports: [
            // ...
            MatMomentDateModule
        ]
    }
    

More info

EdricChan03 avatar Dec 15 '17 06:12 EdricChan03

@Chan4077 How to add a version compatible with material 2.0.0-beta.12?

echosalik avatar Dec 15 '17 08:12 echosalik

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.