Jump to content

Rudy

Members
  • Posts

    154
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Rudy

  1. @psy

    You're almost there. The reason why it always starts with Thursday is because when PHP failed to initiate a date, it defaults to Jan 1, 1970, which falls on Thursday.

    Here is the working code

    $today = time();
    $dayNames = [];
    
    for ($i = 0; $i <= 6; $i++) {
        $daySeconds = $i * 86400;
        $dayTS = $today - $daySeconds;
        $day = date('D', $dayTS);
        $dayNames[] = $day;
    }
    
    var_dump($dayNames);
    
    Output:
    array(7) { [0]=> string(3) "Tue" [1]=> string(3) "Mon" [2]=> string(3) "Sun" [3]=> string(3) "Sat" [4]=> string(3) "Fri" [5]=> string(3) "Thu" [6]=> string(3) "Wed" } 

     

    • Like 2
  2. Hi,

    I am writing a custom module that requires storing array of settings in the module config/settings.

    Is there a built-in fieldtype that allows me to store settings in an array (sort of like Repeater)?

    I tried using InputfieldAceExtended and InputfieldTextarea to store JSON array. Both times, my data was stored in the module settings (in the database) but upon reload, that information was not retrieved.

    Thanks
    Rudy

     

  3. 3 hours ago, matjazp said:

    I upgraded PW to the latest dev using the upgrade module from Ryan (I normally upgrade by hand) and got the message that Upgrade files are already present. Please remove them before continuing. Clicking on Remove button didn't help, had to manually delete /site/assets/cache/ProcessWireUpgrade folder. I'm on windows, I think this is important. Anyone else?

    I encountered the same issue after upgrading to 3.0.118.

    • Like 1
×
×
  • Create New...