Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

DateFormat for mobile View

phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

Hi everybody,

I haven't yet found a way to overwrite the display of the date in the mobile view under 20.18.9. Mobile design needs a more narrow appearance of the date information given than the desktop theme. Wether in the discussion list nor in the comment list. Anyone who can point me in the right direction?

Thanx
phreak

  • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
  • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
Tagged:

Comments

  • Options

    show a screenshot of what you are trying to implement with arrows pointing to what you want to change and to what.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP
    edited December 2013

    Thank you peregrine. Screenshot attached. I marked red what i would like to replace with the date format marked green.

    For the desktop version the date is properly configured and i don't want to change this. I'm looking for a way only to change the date format in the mobile version without touching the way the desktop version displays it.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • Options
    peregrineperegrine MVP
    edited December 2013

    Since you failed to mention the vanilla version - I'll assume in this case you are talking about vanilla 2.0.18.9

    assuming you created your own mobile theme by copying the core mobile theme to your own theme/mymobiletheme and pointed your theme to the new mobile theme in config.php.

    AND you want the date format different ONLY in mobile theme

    in your specific mobile theme you will notice a

    mymobiletheme/views/discussions/helper_functions.php

    change line 41 from

      echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->LastDate).'</span> ';
    
    
    to
    
         echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->LastDate,'%d.%m.%y').'</span> ';
    

    otherwise you could just use definitions if you wanted to globally change it on all themes.

    $Definition['Date.DefaultDayFormat'] =  '%B %e';
    $Definition['Date.DefaultFormat'] = '%B %e, %Y';
    $Definition['Date.DefaultTimeFormat'] =  '%l:%M%p';
    $Definition['Date.DefaultYearFormat'] = '%B %e, %Y';
    

    as far as theme based locale file - I don't know if it works on mobile theme in vanilla 2.0.18.9

    but for non-mobile themes.

    match your locale from config.php
    
    $Configuration['Garden']['Locale'] = 'en-US';
    
     Add defininitions to /themes/YOURTHEMENAME/locale/en-US.php
    
    Delete /cache/locale_map.ini  or all ini files if you want.
    
    
    
    the order or sequence of definitions is
    
         1 - application based and dashboard based definitions
        2- plugin based - plugins/SphinxSearch/locale/en-US.php"
        plugins/SphinxSearch/locale/en-US/definitions.php
        3 - theme based /themes/YOURTHEMENAME/locale/en-US.php
        4 - locale based - /locales/en-US/definitions.php"
        5 - locale based /vanilla/locales/en-US/other_definitions.php"
        6- conf based /vanilla/conf/locale.php"
        7- conf - specialized /www/vanilla/conf/locale-en-US.php"
    
    it will be overruled by the highest number.
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited December 2013

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.