Yii Framework Forum: [EXTENSION] Date picker (jQuery UI based) - Yii Framework Forum

Jump to content

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] Date picker (jQuery UI based) Rate Topic: -----

#1 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 03 December 2008 - 01:06 AM

http://www.yiiframew.../juidatepicker/

Post your bug reports here :)
0

#2 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 04 December 2008 - 03:56 PM

A bug was reported on the extension page:

Quote

this extension is really good, but DIRECTORY_SEPARATOR is not working well under windows. i have to change DIRECTORY_SEPARATOR to '/' when i use it under windows


DIRECTORY_SEPARATOR comes from Yii's core, right? is it directly available to extensions or do we need to use it like Yii::DIRECTORY_SEPARATOR or something like that? Is it working on Windows?
0

#3 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,899
  • Joined: 04-October 08
  • Location:DC, USA

Posted 04 December 2008 - 04:07 PM

DIRECTORY_SEPARATOR is a constant defined by PHP.
0

#4 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 04 December 2008 - 04:47 PM

Indeed Qiang  ;D (too tired, sorry). Then the reviewer had a broken installation... dunno.
0

#5 User is offline   hellowayne 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 02-December 08

Posted 04 December 2008 - 10:29 PM

setlanguage() did not work when set 'zh-CN'.(validatelanguagearray has no value of zh-CN,zh-TB..., and the check method is wrong. ). is there any way to change the size of datepicker panel? and there is no way to change the dateformat to such as "mm/dd/yy","m-d-Y".
0

#6 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 05 December 2008 - 12:48 AM

Quote

setlanguage() did not work when set 'zh-CN'.(validatelanguagearray has no value of zh-CN,zh-TB..., and the check method is wrong. ).


It currently works only with two letters code, a workaround is to rename the zh-CN or zh-TW to zh as needed.

Quote

is there any way to change the size of datepicker panel?


You would need to alter or create a theme. Take a look at this theme found in the jQuery UI demo page.

Quote

and there is no way to change the dateformat to such as "mm/dd/yy","m-d-Y".


Did you try the [tt]dateFormat[/tt] configuration parameter?
0

#7 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 05 December 2008 - 01:10 AM

Quote

and there is no way to change the dateformat to such as "mm/dd/yy","m-d-Y".

Ok, you found a bug here. It's fixed in 1.1. Thanks  :)

Please update the widget!
0

#8 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 05 December 2008 - 01:48 AM

Just added support for zh_CN, zh_TW and pt_BR languages in 1.2
0

#9 User is offline   hellowayne 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 02-December 08

Posted 05 December 2008 - 07:16 AM

it looks great, but about the DIRECTORY_SEPARATOR, is there any good way to make it work on both win* and *inux?
0

#10 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,899
  • Joined: 04-October 08
  • Location:DC, USA

Posted 05 December 2008 - 07:37 AM

Please check this: http://us2.php.net/m...r.constants.php
0

#11 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 05 December 2008 - 08:59 AM

Hmm, I found something:

http://www.talkphp.c...-necessary.html
http://us2.php.net/m...ystem.php#73954
http://marc.info/?l=...76927027525&w=2

It seems that, at least in recent PHPs. there's no need for [tt]DIRECTORY_SEPARATOR[/tt] after all, and using [tt]/[/tt] will work just fine.

hellowayne, could you provide details? which PHP version are you using? which server?
0

#12 User is offline   hellowayne 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 02-December 08

Posted 05 December 2008 - 09:04 AM

as i know function registerScriptFile($url) and registerCssFile($url) actually accept a url format that is using '/' as separator, however DIRECTORY_SEPARATOR =='\' .
so the path will become something like
/assets/edd489d9\ui\i18n\ui.datepicker-en.js . why do not just use '/' ? is there any good reason to use DIRECTORY_SEPARATOR for create url path?
0

#13 User is offline   hellowayne 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 02-December 08

Posted 05 December 2008 - 09:12 AM

i am using php 5.25 , apache 2.2 ,
0

#14 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 05 December 2008 - 09:23 AM

Quote

as i know function registerScriptFile($url) and registerCssFile($url) actually accept a url format that is using '/' as separator, however DIRECTORY_SEPARATOR =='\' .

so the path will become something like

/assets/edd489d9\ui\i18n\ui.datepicker-en.js . why do not just use '/' ? is there any good reason to use DIRECTORY_SEPARATOR for create url path?


Ok, I see where the problem is. It has nothing to do with a malfunction in DIRECTORY_SEPARATOR, but with its use in the URL registration. Fixed in 1.3. Thanks.
0

#15 User is offline   hellowayne 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 02-December 08

Posted 06 December 2008 - 07:44 AM

great ! it works fine now. another issue about theme. as you suggested, create a new theme css may change the size of datepicker panel , but i think it is inconvenience. if there is a parameter (panelsize) for user to initialize the size of datepicker panel, that will be wonderful.
do you think is possible ? i think is can be achieved by registered a piece of javascript code. i did a test when i change the font-size using piece of javacode, the datepicker panel changed.
add one line code in run function as following

  public function run()
  {...
      $cs->registerScript(get_class($this).'_'.$id, $js);
$cs->registerScript('theme-panel-size','jQuery("#ui-datepicker-div").css("font-size","0.5em")');
      echo $html;
  }
therefore i do believe the datepicker panel size can be customized as well. just like set language, theme ect. what do you think?
0

#16 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 06 December 2008 - 07:49 PM

Done, thanks for the hint.
0

#17 User is offline   hellowayne 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 02-December 08

Posted 06 December 2008 - 08:06 PM

fantastic job.  ;)
0

#18 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 07 December 2008 - 02:08 PM

Added support for [tt]fadeIn[/tt] and [tt]slideDown[/tt] effects.

There are several other effects, but they don't seem to work when included with the example code code (see the [tt]showAnim[/tt] option)  ??? . I'll try to ask in the jQuery's mailing list, but if someone is more experienced with jQuery or this jQuery UI widget, your help is appreciated!  ;)
0

#19 User is offline   Kaerigan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 05-December 08
  • Location:Sweden

Posted 08 December 2008 - 04:10 PM

Ok, now this might be a basic misunderstanding of extensions or there is something wrong with this extension. I've tried using it by doing:

$this->widget(
    'application.extensions.juidatepicker.EDatePicker',
    array(
          'model' => $form,
          'attribute' => 'birthdate'
    )
);


Where $form is an instance of CFormModel.

And then I get the following error:

The asset "<snip>\protected\extensions\juidatepicker\jquery" to be pulished does not exist.

I guess I'd be able to fix this by adding a jquery directory and appropriate files, but is that really how I should do it, since I believe that jQuery is part of the core of this framework? Please forgive my n00bness.
0

#20 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 08 December 2008 - 05:18 PM

Hi Kaerigan,

you need to do a [tt]tar xzvf juidatepicker-1.5.tar.gz[/tt] (or use Winzip, since as I guess you're on Windows) to extract the contents of the tarball inside a directory called [tt]extensions[/tt] in your project's [tt]protected[/tt] directory (this is just a convention). This will create a [tt]jquery[/tt] directory inside the extension directory, and this last one will contain the jquery plugin which renders the calendar, and some CSS and images for the look and feel. Make sure that you're extracting all the files using "original paths". Let me know if this works for you.
0

Share this topic:


  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users