进行中

Easy If sentence to change Date Format in Smarty Template for WHMCS

Hello I am using WHMCS as a billing system, which uses Smarty templates to show client area pages.

WHMCS does not provide a way to format the dates according to client country, so I need to find a way to do that, modifying the client area template files.

I already found a way to do it, adding this if sentence inside the template files:

{if $[url removed, login to view] eq "Argentina"}

{$datedue|date_format:"%d/%m/%y"}

{elseif $[url removed, login to view] eq "United States"}

{$datedue|date_format:"%m/%d/%y"}

{else}

{$datedue|date_format:"%m/%d/%y"}

{/if}

But as $datedue is just one of several possible variables for dates, I need to find a way in which I could set just the date format modifier inside the if sentence, and then apply that modifier to each date variable.

Something like this:

{if $[url removed, login to view] eq "Argentina"}

$datelocalformat = "%d/%m/%y"

{elseif $[url removed, login to view] eq "United States"}

$datelocalformat = "%m/%d/%y"

{else}

$datelocalformat = "%m/%d/%y"

{/if}

{$datedue|date_format:"$datelocalformat"}

So basically I need to know what expressions should I use instead of $datelocalformat = "%m/%d/%y" inside the if statement, and then what to use instead of {$datedue|date_format:"$datelocalformat"}.

技能: PHP, Smarty PHP, WHMCS

查看更多: whmcs smarty template, change format date excel macro, zencart change date format date expected, change html template whmcs, hosting template whmcs integration, free template whmcs, smarty template css, smarty template engine adodb, smarty template css creation, smarty template slicen, smarty template expert, smarty template designer, smarty template creator, smarty template logic, template whmcs

About the Employer:
( 8 reviews ) Buenos Aires, Argentina

项目ID: #12151595

已悬赏给:

LeonardVoicu

FrontEnd Developer -Programming languages and technologies HTML /HTML5, CSS 3, PHP, Bootstrap, Joomla/Joomla-Viruemart(medium knowledge), SEO(Bing,Google-Webmaster Tools) , Prestashop , JavaScript, AJAX , Smarty(bas 更多

$13 USD 在1天内
(0条评论)
0.0

4名威客为此工作的平均竞标价是$22

mahander2012

Dear Hiring Manager, I have 5 years of experience in web development and web designing using php and java technology and expertise in WHMCS,Linux Server Administration, eCommerce using magento, wordpress and prestas 更多

$30USD 在1天里
(84条评论)
6.2
mascotsoft4

Dear Client, Greeting of the day ahead !!! Thanks for providing us opportunity to place bid over the project and communicate with you. I am a serious bidder here and i have already worked on a similar project befor 更多

$23 USD 在6天内
(0条评论)
0.0
mariuszwintoch

I'm using smarty from 2011:)

$20USD 在1天里
(0条评论)
0.0