1. #1
    Ext User
    Join Date
    May 2009
    Posts
    9
    Vote Rating
    0
    giovannotti is on a distinguished road

      0  

    Default Get Months

    Get Months


    I would like to know if is possible to get the current month and the two previous ones with ext?

  2. #2
    Ext User javarine's Avatar
    Join Date
    May 2008
    Posts
    21
    Vote Rating
    0
    javarine is on a distinguished road

      0  

    Lightbulb Getting months

    Getting months


    I'm sure you can do that with just plain ol' javascript.

    Var d = new Date();

    var month = d.getCurrentMonth();

    var last_month = month -1;

    var month_before_last = month - 2;

    Some code like that should get you what you want....

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    And what if the "month" was 0?

    last_month -1? OK?

    http://extjs.com/deploy/ext-3.0-rc1....ate&member=add

  4. #4
    Ext User javarine's Avatar
    Join Date
    May 2008
    Posts
    21
    Vote Rating
    0
    javarine is on a distinguished road

      0  

    Thumbs up some month function thingy

    some month function thingy


    I'm sure you can write some custom function to handle that.

    Code:
     
    function workTheMonths(month){
          if(month == -1){
               return 12;
          }
          else if(month == -2){
               return 11;
          }
     
    }

  5. #5
    Ext User
    Join Date
    May 2009
    Posts
    9
    Vote Rating
    0
    giovannotti is on a distinguished road

      0  

    Default


    throws d.getCurrentMonth is not a function

    if the current moth = 0, the value to show for the past month must be 11.

  6. #6
    Ext User javarine's Avatar
    Join Date
    May 2008
    Posts
    21
    Vote Rating
    0
    javarine is on a distinguished road

      0  

    Thumbs up getMonth should do the trick

    getMonth should do the trick


    Oh, yeah.
    d.getMonth() is the javascript function.


    function whatIsLastMonth(month){
    var last_month = month - 1;

    if(last_month == -1 )
    return 11;

    }

    You can do the same thing for the month before last.
    Happy coding

  7. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Mmmm yeah. Real lot of point to that.

  8. #8
    Ext User javarine's Avatar
    Join Date
    May 2008
    Posts
    21
    Vote Rating
    0
    javarine is on a distinguished road

      0  

    Talking All i can offer, i offer to y'all

    All i can offer, i offer to y'all


    Thanks Nige:
    It is my pleasure to spread the gospel of javascript according to Ext.
    Catcha...

  9. #9
    Ext User
    Join Date
    May 2009
    Posts
    9
    Vote Rating
    0
    giovannotti is on a distinguished road

      0  

    Default


    Thanks, that work perfect

  10. #10
    Sencha User
    Join Date
    Mar 2007
    Posts
    13
    Vote Rating
    0
    iamakimmer is on a distinguished road

      0  

    Default


    isn't this cleaner?

    var d = new Date();
    console.info(d.format('n'));
    console.info(d.add(Date.MONTH, -1).format('n'));
    console.info(d.add(Date.MONTH, -2).format('n'));

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi