If this is your first visit, check our documentation. To post, register or login.
Forums / Upgrading Your Zen Cart / Upgrading to 2.x.x / Beta1 build of 2.1.0 Ready for Test

Beta1 build of 2.1.0 Ready for Test

Started by swguy on 30 Sep 2024, 11:08 AM · Views: 618

Results 1 to 3 of 3
30 Sep 2024, 11:08 AM
#1
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Post #1 by swguy

Please try it out and post questions related to 2.1.0 on this thread. Thank you!

https://github.com/zencart/zencart/releases/tag/v2.1.0-beta1

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

1 Oct 2024, 5:01 PM
#2
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,819
Plugin Contributions:
24

Post #2 by balihr

Would you consider a new function in functions_dates.php?

function zen_datetime_short_frontend ($raw_datetime)
{
    if (empty($raw_datetime) || $raw_datetime <= '0001-01-01 00:00:00') return false;

    $year = (int)substr($raw_datetime, 0, 4);
    $month = (int)substr($raw_datetime, 5, 2);
    $day = (int)substr($raw_datetime, 8, 2);
    $hour = (int)substr($raw_datetime, 11, 2);
    $minute = (int)substr($raw_datetime, 14, 2);

    global $zcDate;
    $formattedDate = $zcDate->output(DATE_FORMAT, mktime(0, 0, 0, $month, $day, $year));

    $formattedTime = sprintf('%02d:%02d', $hour, $minute);

    return $formattedDate . ' ' . $formattedTime;
}

Specifically, I'm trying to display order status history with date and time, but without seconds. Perhaps might be useful elsewhere as well.

My site - Pro ZC Help
My portfolio | My plugins

1 Oct 2024, 5:04 PM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Post #3 by swguy

Please submit a PR. This would be nice to have.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.