Support Forum

If you want to show a shortcode in forum post - use [ instead of [ as you write it so you can see the shortcode 😉

We use and recommend UK2 for hosting - get a month free

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register sp_MemberList Members

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Add rota results in rota_date 1970-01-01
18th September 2013
10:15 am
Avatar
Member
Members
Forum Posts: 11
Member Since:
18th September 2013
sp_UserOfflineSmall Offline

Hi,

when adding a rota this results in a rota_date of 1970-01-01 (which will be never displayed)
(I'm running with "define('WPLANG', 'de_DE');")

With some debuggig I've found:
church-adminincludesrota.php: #263 rota_date: 20 Okt 2013
church-adminincludesrota.php: #269 date: 1970-01-01
church-adminincludesrota.php: #280: SELECT rota_id FROM wp_church_admin_rotas WHERE rota_date="1970-01-01"AND service_id="1"

church-adminincludesrota.php: #297: INSERT INTO wp_church_admin_rotas (rota_jobs,rota_date,service_id)VALUES("a:6:{i:1;s:6:"a:0:{}";i:2;s:6:"a:0:{}";i:3;s:6:"a:0:{}";i:4;s:6:"a:0:{}";i:5;s:6:"a:0:{}";i:6;s:6:"a:0:{}";}","1970-01-01","1")

church-adminincludesrota.php: #317

the following line creates a string which is not "re-translated" correctly with strtotime:
if(!empty($next_date)) echo ' value="'.mysql2date("d M Y",$next_date).'" ';
(next_date: 2013-10-06 mysql2date= 06 Okt 2013)

It looks as if within church-adminincludesrota.php: line #263
$date=date('Y-m-d',strtotime($_POST['rota_date']));

If the string in the form is modified from "Okt" to "Oct" everything works fine

==> looks like an internationization issue

Thanks

Martin

18th September 2013
10:48 am
Avatar
Admin
Forum Posts: 868
Member Since:
4th March 2015
sp_UserOfflineSmall Offline

It sure is an internationalisation issue.
Your Wordpress is set up for German, but your server isn't by the looks of things. So the strtotime function only recognised English input.

I need to look into it more, but a quick Google suggests that
[code]setlocale(LC_TIME, WPLANG);[/code]
in wp-config.php may fix it or even in the plugin index file!

Do you want to try it and come back to me please? If it works I will put it in the plugin as it should then work globally for all users

If you are finding the plugin useful, please subscribe to the app - it's free for your congregation to use and only £9.99pm for a church subscription - free int'l bank transfers with Revolut

18th September 2013
11:39 am
Avatar
Member
Members
Forum Posts: 11
Member Since:
18th September 2013
sp_UserOfflineSmall Offline

Hi,

added the line into the plugin index.php ==> same result

attached is a simple test script - the output is:
line #10: Indate: 20 Okt 2013, strtotime (): , date: 1970-01-01

Thenks
Martin

18th September 2013
12:32 pm
Avatar
Admin
Forum Posts: 868
Member Since:
4th March 2015
sp_UserOfflineSmall Offline

So we have discovered strtotime can't be localised and also googled checked php.net to confirm!
I'll force the date picker to output YYYY-MM-DD and adjust the labels to specify date should be YYYY-MM-DD - it'll be in next update as I'll need to fix the directory, rota and possibly calendar too.

If you are finding the plugin useful, please subscribe to the app - it's free for your congregation to use and only £9.99pm for a church subscription - free int'l bank transfers with Revolut

Forum Timezone: Europe/London

Most Users Ever Online: 101

Currently Online:
4 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Pastor Andres: 97

Rich Cox: 94

David Z.: 84

rrfranks: 57

seanmcint: 52

Allen: 51

Jon: 44

Gavin: 41

Janeen: 23

365sussex: 21

Member Stats:

Guest Posters: 44

Members: 409

Moderators: 0

Admins: 1

Forum Stats:

Groups: 5

Forums: 14

Topics: 571

Posts: 2122

Administrators: andymoyle: 868