Fork me on GitHub
Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Nominate XOOPS!

Learn XOOPS Core

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 4 6 Abuse adslight Android AntiHarvesting AntiSpam API Apple Battlefield billige Blocks Bootstrap Captcha cell cent chronolabs CHUNG Clicks content CĂN demo download Dresses eve facebook Fat floor for free Gateway Google Guide herre Home Honeypot html5 Human HỘ IP iPhone jQuery Language List log Loss module modules Monster new newbb news NHÀ online PARK Payment phone PHP Prevention profile project Protector publisher RESIDENCE responsive review Rights rmcommon Room security Sentry site Smartphone Smarty Smoking Spam stem Studio support tag tags tdmcreate template The Theme themes User userlog web weight xoops Xortify XPayment ZendFramework

New Users

Registering user

# 137636

mzmaker05

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  Register To Post

(1) 2 »


#1 Posted on: 2012/6/28 4:58 JQuery UI formdatepicker
I've created a special class in the folder class/xoopsform as formdatepicker.php. The result is being able to delete many files from the old calendar, and use a simple method call using the id and using the datepicker plugin of jquery datepicker.js

Read News

Top


Blog| Modules, Themes, Tutorials|[url=http://mobile.txmodxoops.org]
timgno
Module Developer
Module Developer
Joined:
2007/6/21 13:54
From Italy
Group:
Registered Users
Posts: 1234
(Show More) (Show Less)


#2 Posted on: 2012/6/30 7:41 Re: JQuery UI formdatepicker
Hi timgno,
Im really really glad to see this famous JQUERY Calendar in xoops.
Voltan requested it about one year ago here:
https://sourceforge.net/tracker/?func= ... roup_id=41586&atid=430843

To encourage community please show some xoops forms in action.

In my idea this is the best calendar that provide us local date support.

Persian community can go to this link to see this calendar in action (patches , ...):
http://hasheminezhad.com/datepicker

But still we have a very big problem with "strtotime" function.
Please see my solution here:
https://sourceforge.net/tracker/?func= ... roup_id=41586&atid=430843

is there any better solution for that?


Top


Ready for Romance
First Persian Harry Potter Site(English added) | Persian Support Site | Xoops Persian Project
irmtfan
Module Developer
Module Developer
Joined:
2003/12/7 14:14
From In the middle of nowhere
Group:
Registered Users
Community Coordinator (temporary)
Posts: 3367
(Show More) (Show Less)


#3 Posted on: 2012/6/30 8:08 Re: JQuery UI formdatepicker
With php 5.3 using the datetime class would be a solution.

Example

$date "08/04/2011"// Datepicker format

$obj DateTime::createFromFormat('d/m/y'$date);
$timestamp $obj->getTimestamp();


Top


Programming is like sex:
One mistake and you have to support it for the rest of your life.
culex
Module Developer
Module Developer
Joined:
2004/9/23 5:26
From Skagen, Denmark
Group:
Registered Users
Repository Group
Posts: 639
(Show More) (Show Less)


#4 Posted on: 2012/6/30 9:19 Re: JQuery UI formdatepicker
Precisely at this moment I've updated the class definitions as _CAL_FORMAT and others in calendar.php in language files, and other definitions have added, short text and mini text for the week.

Download from my site, use the link above

Top


Blog| Modules, Themes, Tutorials|[url=http://mobile.txmodxoops.org]
timgno
Module Developer
Module Developer
Joined:
2007/6/21 13:54
From Italy
Group:
Registered Users
Posts: 1234
(Show More) (Show Less)


#5 Posted on: 2012/7/1 0:51 Re: JQuery UI formdatepicker
Quote:

culex wrote:
With php 5.3 using the datetime class would be a solution.

Example

$date "08/04/2011"// Datepicker format

$obj DateTime::createFromFormat('d/m/y'$date);
$timestamp $obj->getTimestamp();


Thank you for your attention.
by using datetime class still the problem is remained.
The problem is:
1- we (persian/arabic community) use local date format (Hegira date not Gregorian date)
2- we (persian/arabic community) use local numbers (Not latin 0123456789)

And php functions can not handle local dates and local numbers.

Currently we have "formatTimestamp" function for output date/time and we fully customize it for our needs.

so we have to define a xoops function for input date/time.
we should do the same localization as has been done for formatTimestamp.

Add the function (strtotime / createFromFormat / Xo_strtotime, ANYTHING YOU LIKE) to xoopslocal class.

Then we can use the same procedure: extending the function abilities in languages/OUR_LANG/locale.php)

we just need a function in xoopslocal class. Therefore it is up to developers to define a new xoops function from scratch like formatTimestamp or add the already php functions (strtotime / createFromFormat) like number_format to xoopslocal class.

Also the next most important step is forcing all module/core developers to unify their methods for getting the date/time from user (use THAT XOOPS FUNCTION just like using the formatTimestamp)

@culex:

We can hack every modules and every core and add our above mentioned needs but i want to prevent this kind of localization (hard code and hack).

@ timgno:
I can not see any change here:

http://xoops.svn.sourceforge.net/view ... &view=markup&pathrev=9738

Top


Ready for Romance
First Persian Harry Potter Site(English added) | Persian Support Site | Xoops Persian Project
irmtfan
Module Developer
Module Developer
Joined:
2003/12/7 14:14
From In the middle of nowhere
Group:
Registered Users
Community Coordinator (temporary)
Posts: 3367
(Show More) (Show Less)


#6 Posted on: 2012/7/1 3:05 Re: JQuery UI formdatepicker
download again now is updated

Top


Blog| Modules, Themes, Tutorials|[url=http://mobile.txmodxoops.org]
timgno
Module Developer
Module Developer
Joined:
2007/6/21 13:54
From Italy
Group:
Registered Users
Posts: 1234
(Show More) (Show Less)


#7 Posted on: 2012/7/1 5:48 Re: JQuery UI formdatepicker
@timgno
Thank you.
i investigate it a little but because of my very basic knowledge in javascript i can not fully understand it.
but from my understanding you attempted to add some localization variables.
these definitions in calendar.php is good for Gregorian calendar but for our needs it is not suitable.
I think it would be great if you move them totally to the language folder like this:

$GLOBALS['xoTheme']->addScript(XOOPS_ROOT_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/date/ui.datepicker.js');

the above code is awkward.



Top


Ready for Romance
First Persian Harry Potter Site(English added) | Persian Support Site | Xoops Persian Project
irmtfan
Module Developer
Module Developer
Joined:
2003/12/7 14:14
From In the middle of nowhere
Group:
Registered Users
Community Coordinator (temporary)
Posts: 3367
(Show More) (Show Less)


#8 Posted on: 2012/7/1 5:53 Re: JQuery UI formdatepicker
Download these 2 file and traslate it in your language

http://xoops.svn.sourceforge.net/view ... /htdocs/language/english/

Top


Blog| Modules, Themes, Tutorials|[url=http://mobile.txmodxoops.org]
timgno
Module Developer
Module Developer
Joined:
2007/6/21 13:54
From Italy
Group:
Registered Users
Posts: 1234
(Show More) (Show Less)


#9 Posted on: 2012/7/1 6:15 Re: JQuery UI formdatepicker
@ timgno:
you misunderstood me.
Persian and Arabic communities need more localization than just some definitions.
|for example please see the below code i copy and paste from http://hasheminezhad.com/datepicker

this file is: jquery.ui.datepicker-cc-ar.js [Arabic calendar]

// Mahdi Hasheminezhad. email: hasheminezhad at gmail dot com (http://hasheminezhad.com)
jQuery(function($){
    $.
datepicker.regional['ar'] = {
        
calendarHijriDate,
        
closeText'إغلاق',
        
prevText'السابق',
        
nextText'التالي',
        
currentText'اليوم',
        
monthNames: ['محرّم''صفر''ربيع الأول''ربيع الثاني''جمادى الأولى''جمادى الآخرة''رجب''شعبان''رمضان''شوال''ذو القعدة''ذو الحجة'],
        
monthNamesShort: ['محرّم''صفر''ربيع الأول''ربيع الثاني''جمادى الأولى''جمادى الآخرة''رجب''شعبان''رمضان''شوال''ذو القعدة''ذو الحجة'],
        
dayNames: ['الأحد''الاثنين''الثلاثاء''الأربعاء''الخميس''الجمعة''السبت'],
        
dayNamesShort: ['أحد''اثنين''ثلاثاء''أربعاء''خميس''جمعة''سبت'],
        
dayNamesMin: ['أ''ا''ث''أ''خ''ج''س'],
        
weekHeader'س',
        
dateFormat'dd/mm/yy',
        
firstDay6,
        
isRTLtrue,
        
showMonthAfterYearfalse,
        
yearSuffix'',
        
calculateWeek: function(date) {
            var 
checkDate = new HijriDate(date.getFullYear(), date.getMonth(), date.getDate() + (date.getDay() || 7) - 3);
            return 
Math.floor(Math.round((checkDate.getTime() - new HijriDate(checkDate.getFullYear(), 01).getTime()) / 86400000) / 7) + 1;
        }};
    $.
datepicker.setDefaults($.datepicker.regional['ar']);
});

function 
HijriDate(p0p1p2) {
    var 
gregorianDate;
    var 
hijriDate;

    if (!
isNaN(parseInt(p0)) && !isNaN(parseInt(p1)) && !isNaN(parseInt(p2))) {
        var 
hijri_to_gregorian([parseInt(p010), parseInt(p110), parseInt(p210)]);
        
setFullDate(new Date(g[0], g[1], g[2]));
    } else {
        
setFullDate(p0);
    }

    function 
hijri_to_gregorian(d) {
        var 
gregorian jd_to_gregorian(islamic_to_jd(d[0], d[1] + 1d[2]));
        
gregorian[1]--;
        return 
gregorian;
    }

    function 
gregorian_to_hijri(d) {
        var 
hijri jd_to_islamic(gregorian_to_jd(d[0], d[1] + 1d[2]));
        
hijri[1]--;
        return 
hijri;
    }

    function 
setFullDate(date) {
        if (
date && date.getGregorianDatedate date.getGregorianDate();
        
gregorianDate = new Date(date);
        
gregorianDate.setHours(gregorianDate.getHours() > 12 gregorianDate.getHours() + 0)
        if (!
gregorianDate || gregorianDate == 'Invalid Date' || isNaN(gregorianDate || !gregorianDate.getDate())) {
            
gregorianDate = new Date();
        }
        
hijriDate gregorian_to_hijri([
            
gregorianDate.getFullYear(),
            
gregorianDate.getMonth(),
            
gregorianDate.getDate()]);
        return 
this;
    }

    
this.getGregorianDate = function() { return gregorianDate; }

    
this.setFullDate setFullDate;

    
this.setMonth = function(e) {
        
hijriDate[1] = e;
        var 
hijri_to_gregorian(hijriDate);
        
gregorianDate = new Date(g[0], g[1], g[2]);
        
hijriDate gregorian_to_hijri([g[0], g[1], g[2]]);
    }

    
this.setDate = function(e) {
        
hijriDate[2] = e;
        var 
hijri_to_gregorian(hijriDate);
        
gregorianDate = new Date(g[0], g[1], g[2]);
        
hijriDate gregorian_to_hijri([g[0], g[1], g[2]]);
    };

    
this.getFullYear = function() { return hijriDate[0]; };
    
this.getMonth = function() { return hijriDate[1]; };
    
this.getDate = function() { return hijriDate[2]; };
    
this.toString = function() { return hijriDate.join(',').toString(); };
    
this.getDay = function() { return gregorianDate.getDay(); };
    
this.getHours = function() { return gregorianDate.getHours(); };
    
this.getMinutes = function() { return gregorianDate.getMinutes(); };
    
this.getSeconds = function() { return gregorianDate.getSeconds(); };
    
this.getTime = function() { return gregorianDate.getTime(); };
    
this.getTimeZoneOffset = function() { return gregorianDate.getTimeZoneOffset(); };
    
this.getYear = function() { return hijriDate[0] % 100; };

    
this.setHours = function(e) { gregorianDate.setHours(e) };
    
this.setMinutes = function(e) { gregorianDate.setMinutes(e) };
    
this.setSeconds = function(e) { gregorianDate.setSeconds(e) };
    
this.setMilliseconds = function(e) { gregorianDate.setMilliseconds(e) };
}


you can see there are some other new functions like HijriDate.
So IMO it is better to move the whole customizations (definitions for Garegorian Calendar and definitions + functions for other calendars) to language folder.


Top


Ready for Romance
First Persian Harry Potter Site(English added) | Persian Support Site | Xoops Persian Project
irmtfan
Module Developer
Module Developer
Joined:
2003/12/7 14:14
From In the middle of nowhere
Group:
Registered Users
Community Coordinator (temporary)
Posts: 3367
(Show More) (Show Less)


#10 Posted on: 2012/7/1 6:51 Re: JQuery UI formdatepicker
This is the result in the Italian language:

Resized Image


Send your picture like mine to show me your result

Top


Blog| Modules, Themes, Tutorials|[url=http://mobile.txmodxoops.org]
timgno
Module Developer
Module Developer
Joined:
2007/6/21 13:54
From Italy
Group:
Registered Users
Posts: 1234
(Show More) (Show Less)




(1) 2 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You can vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.

[Advanced Search]