I'd like to display the Hebrew month automatically in my Mailchimp's newsletter. So I think I need to set the date locale to Herbew. How do I set the date locale?
I saw this similar question from 2013 but it doesn't work anymore. (maybe the functionality has changed?)
I'm using this list (cheat sheet) of Mailchimp tags.
Based on tag *|DATE: F Y|* and *|TRANSLATE:HE|* it should give me the desired result, but instead supplies me a list of languages to translate my page into and I just want the date locale to be set to Israel.
Information about PHP format and date locale: here.
Thanks in advance!.
Unfortunately, I don't think that's possible. Would love if I was wrong though.
Related
I'm working on a bilingual WordPress project which is translated with TranslatePress plugin. Sadly TranslatePress ignores all number fields and won't let me change their values depending on the countries number format. The offiical support team told me, it's not possible at this moment.
The original language of the page is German and the second language is English. The page contains a lot of number information for cities etc. which are put in like this 13.502.552 Since TranslatePress won't let me convert these numbers by hand I'm looking for a way to convert them for the entire site maybe through functions.php, is this possible? Is there a way to check if locale is set to en_GB and to convert all the numbers to 13,502,552 on the fly?
I already came across number_format_i18n, but could not find a way to use it properly for my purpose.
Any ideas?
I am trying to add a Google calendar to a website I'm making that the client will be able to update themselves. I found this: http://mikeclaffey.com/google-calendar-into-html/ which has been quite helpful, but I am a bit stuck.
The website I am building is using PHP template and the page contents is contained within the $content variable. Here is the link I'm working on: http://victoriasawyer.com/AmosTheTransparent.
The calendar feed is the top one of the two lists of Tour Dates. I would like the top one to look similar to the bottom one. The same would be ideal but not necessary.
The biggest issue I'm having is with the start date and time. In the title of the event I would like just the date to show (preferably like 10/03/14) not the time. I have figured out how to display just the time separately without issue. Is there some way to change the date format?
The other issue I'm having is the order that the events are appearing. I would like the events to show with the soonest one first in the list and the furthest one last in the list. I added the additional parameters as instructed in the tutorial (orderby=starttime and sortorder=ascending) but they do not display correctly.
The url I am using is: https://www.google.com/calendar/feeds/qmfadhgtq2kmabsi3dlb456v98%40group.calendar.google.com/public/full?orderby=starttime&sortorder=ascending&futureevents=true&alt=json. Is there something I can adjust or add to fix the order?
Any help will be much appreciated (even if you can recommend an alternative. It just needs to be customizable, and so far this seems to be the best option I have found).
You can use PHP's DateTime class like this:
$date = new DateTime('Sun Nov 16 2014 00:30:00 GMT+0000');
echo $date->format('Y-m-d');
You can then use the predefined formats in PHP which are listed here to format it into whatever style you like.
echo $date->format('d/m');
echo $date->format('d/m/Y');
I'm using CodeIgniter and I have tons of date('format',strtotime(unixtimestamp)) methods in my views.
So when user choose his own language and I would like to automatically convert all datetimes to locale time zone for all my views.
Is there any recursive way to make this possible?
The infos i get from users is their selected language:
it = Italian
fr = French
es = Espanol
etc... so i get lang key codes
I sincerely can't get anything out of my head.
Any help appreciated, really. Thanks.
Depending how you store the timezone preference, you could use date_default_timezone_set().
For example:
date_default_timezone_set('America/New_York');
Note: I'm not familiar with CodeIgnitor, but so long as you set this in a bootstrap or config script, that is before you call date(), this will automatically display all dates in the set locale.
How can I create a calendar in PHP?
Today should be in bold. How could it be coded?
You can try dhtml Calendar, or maybe Yahoo UI's Calendar.
PHP: date should give you everything you need.
Then, format everything in a table.
Firstly, start by capturing your requirements (should it handle month browsing, should it show a week at a time, etc.) - this should let you derive a functional spec of sorts, which should guide you when actually writing the component/page/application
If you mean: "how to show a date picker on your web page from PHP", the answer is to use some default JavaScript library for it. E.g. Dojo or jQuery.
my site changes its locale dependent upon either user settings or browser settings (where the user hasn't set their preference). I am using amline charts, the stock chart specifically, which requires the date format in 'MM/DD/YYYY' or 'DD-MM-YYYY', I guess so the chart knows how to understand the dates. There are many ways to format a date dependent upon the computer locale, however I can't find a way to get the locale format (as above).
What's the problem?
date('m/d/Y')
or
date('d-m-Y')