1. #1
    Ext User
    Join Date
    Oct 2007
    Posts
    40
    Vote Rating
    0
    francodacosta is on a distinguished road

      0  

    Arrow Ext.fc.fuzzyDate - a nice way to present date and time

    Ext.fc.fuzzyDate - a nice way to present date and time




    About

    The FuzzyDate plugin was inspired by the TimeAgo plugin for jQuery . I needed something similar for ExtJs. Since i didn't find it I decided to build one for ExtJs.

    The ideia is instead of showing a timestamp to the user show a more friendly message like one hour ago or 3 months from now

    Features
    • Updates timestamps automatically, avoiding timestamps dated "1 minute ago" even though the page was opened 10 minutes ago
    • Multiple languages supported
    • Fully Customizable
    • You can define several date formats that will be used to convert the date string to an Ext Date object
    • if don't need automatic updates neither want to have it atached to an element you can simply get the translated date with the translate() function

    Download

    http://francodacosta.com/demos/extjs/fuzzydate/


    Cheers

    Nuno

  2. #2
    Sencha User BIS's Avatar
    Join Date
    Oct 2008
    Posts
    31
    Vote Rating
    0
    BIS is on a distinguished road

      0  

    Default was looking for a long time ago

    was looking for a long time ago


    thnx for sharing,

    i once stumbled on this and it certainly impressed me
    thnx for porting this nice widget


    +1

  3. #3
    Sencha User MD's Avatar
    Join Date
    Mar 2007
    Posts
    178
    Vote Rating
    0
    MD is on a distinguished road

      0  

    Default


    Awesome! A perfect fit with TwitterPanel ux

  4. #4
    Sencha Premium Member dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,083
    Vote Rating
    44
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      0  

    Default


    Sweet... this will great for last login wording!!

    @MD... ah so sad... please don't degrade Ext to use with Flutter... er twitter!
    Teahouse Training Company
    Official Certified Sencha Trainer

    Australia / New Zealand / Singapore / Hong Kong & APAC



    SenchaWorld.com - Sencha webinars, videos, etc
    SenchaForge.org - (coming soon)
    TeahouseHQ.com - Sencha ecosystem training portal

    Code Validation : JSLint | JSONLint | JSONPLint

  5. #5
    Ext User
    Join Date
    Oct 2007
    Posts
    40
    Vote Rating
    0
    francodacosta is on a distinguished road

      0  

    Default


    Quote Originally Posted by MD View Post
    Awesome! A perfect fit with TwitterPanel ux

    Quote Originally Posted by dawesi View Post
    Sweet... this will great for last login wording!!

    @MD... ah so sad... please don't degrade Ext to use with Flutter... er twitter!
    I'm glad you liked it

  6. #6
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    Quote Originally Posted by MD View Post
    Awesome! A perfect fit with TwitterPanel ux
    Hi - wondering, i didn't see that. I just write a twitter ux as i used it in my applications (TYPO3), it's like this: http://dev.sk-typo3.de/cetest/web-widgets/twitter.html

    @francodacosta thx, i will test. One problem i see is the localization. This is a tricky one.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  7. #7
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    671
    Vote Rating
    0
    Dumbledore is on a distinguished road

      0  

    Default


    something is wrong here...

    When i try following sample:

    Code:
           var f = new Ext.fc.fuzzyDate();
           alert ( f.translate('2009-12-25') );
    firebug says : TypeError: options is undefined Line 176

    is options a required parameter when use translate()?

    Bye, Dumbledore

  8. #8
    Ext User
    Join Date
    Oct 2007
    Posts
    40
    Vote Rating
    0
    francodacosta is on a distinguished road

      0  

    Default


    Hi Dumbledore,

    options should be optional


    just add this after line 175

    if(!options) options = processOptions({}) ;


    cheers

  9. #9
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    671
    Vote Rating
    0
    Dumbledore is on a distinguished road

      0  

    Default


    is it possible to make a config a la:

    show me fuzzydates about now - 3 month, else show normal dates?

    Bye, Dumbledore

  10. #10
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    671
    Vote Rating
    0
    Dumbledore is on a distinguished road

      0  

    Default


    i change the translate function to this:

    Code:
    ,
    translate: function(str, options) {
        var opt = {};
        Ext.apply(opt, options, processOptions({}));
    
        var d = parseDate(str, opt.dateFormats);
        if (d) {
            return (dateTimeToString(d, opt));
        } else {
            if (opt.onErrorWriteTitle) return (str);
        }
        return false;
    }
    so it is possible to set only a small set of options like the translation. In the original i must set all options...
    Perhaps it helps...


    Bye Dumbledore
    Last edited by mystix; 4 Aug 2009 at 10:50 PM. Reason: why can't you format your code for readability... it only takes 2 seconds...

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