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: -----

#21 User is offline   Kaerigan 

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

Posted 09 December 2008 - 04:34 AM

Darn it, I thought 7-Zip could handle tar.gz properly. Yes, I know that extensions are supposed to go in the extensions directory. Kind of makes sense. Will extract via tar instead (I believe it's available for MSYS). Sorry, I thought that there was something wrong with this extension, it never crossed my mind that my extracting utility of choice might've messed up.
0

#22 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 09 December 2008 - 06:57 AM

From my experience 7-Zip can handle .tar.gz files. But you might have to run it twice: It first unzips it, giving you a .tar file. Then you have to unpack that .tar file.
0

#23 User is offline   MetaYii 

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

Posted 09 December 2008 - 09:42 AM

You can gunzip  the gz and then use this.
0

#24 User is offline   Kaerigan 

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

Posted 09 December 2008 - 10:02 AM

Quote

From my experience 7-Zip can handle .tar.gz files. But you might have to run it twice: It first unzips it, giving you a .tar file. Then you have to unpack that .tar file.

Yes, I'm pretty sure I've been able to earlier, but this time something odd happened; first a .tar shows up (normal), then when I extract it I get a dialog box saying "<something> seems to be an archive. Would you like to extract it?" which has never happened before.

Thanks, MetaYii. Turns out I already had tar. Four copies in fact (the more the better! >_<) : P
0

#25 User is offline   MetaYii 

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

Posted 09 December 2008 - 11:03 AM

Version 1.6 - code cleanup
0

#26 User is offline   sebas 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 496
  • Joined: 28-October 08
  • Location:Buenos Aires, Argentina

Posted 17 December 2008 - 02:53 PM

Congratulations!  It works great.

Just a small improvement suggestion:

It will be cool if the extension could take the default language from the application language selection and if it's not set use english as default.

If the default language doesn't exist, then you select english.

:D




0

#27 User is offline   me23 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 20-October 08
  • Location:Germany

Posted 25 December 2008 - 06:18 PM

Hi,

i've got a problem by setting the attribute name to the following:

array(
'name'=>'filter[fromDay]',
'value'=>$this->Filter['fromDay'],
'theme'=>'cupertino',
'language'=>'de',
'mode'=>'focus',
'fontSize'=>'1.5em',
'dateFormat'=>'dd.mm.yy',
'htmlOptions'=>array(
'size'=>8
)
)



but the Name will then converted to
filter_fromDay


As workaround i changed Line 583
 $html = CHtml::textField($this->htmlOptions['id'], $this->value, $this->htmlOptions);

to
 $html = CHtml::textField($this->name, $this->value, $this->htmlOptions);


But this will break on future updates....

Greetings from Germay
me23


0

#28 User is offline   MetaYii 

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

Posted 25 December 2008 - 07:36 PM

@me23: changed in 1.7, can you try?
0

#29 User is offline   MetaYii 

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

Posted 25 December 2008 - 10:18 PM

Quote

It will be cool if the extension could take the default language from the application language selection and if it's not set use english as default.

If the default language doesn't exist, then you select english.


Done in 1.8
0

#30 User is offline   me23 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 20-October 08
  • Location:Germany

Posted 01 January 2009 - 12:17 PM

Hi MetaYii,

thanks a lot, works like a charm now.

Greetings from Germany
me23

0

#31 User is offline   joel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 02-January 09

Posted 02 January 2009 - 11:13 AM

Hi, i'm new to Yii.

I've just got datepicker working, and i can set the fontSize in the view, but shouldn't it be possible to set it in the config file, so it would be set site wide?

Setting the fontSize:

in the view (works):
<?php $this->widget('application.extensions.juidatepicker.EDatePicker',array('model'=>$weightform,'attribute'=>'date','fontSize'=>'0.8em'))?>


in the config (doesn't work - fontSize is ignored):
'juidatepicker'=>array(
'class'=>'application.extensions.juidatepicker.EDatePicker',
'fontSize'=>'0.8em'
),


Regards,
Joel
0

#32 User is offline   me23 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 20-October 08
  • Location:Germany

Posted 02 January 2009 - 01:02 PM

Hi MetaYii,

i've got a new issue, by trying to set 'rangeSelect' in options, it seems that the options will be overwritten in Line 546:


if ($this->mode !== 'advanced') {
    $this->options = $this->makeOptions($baseUrl);
}


my current Workaround is following:

if ($this->mode !== 'advanced') {
        $this->options = array_merge($this->options, $this->makeOptions($baseUrl));
      }


and here is the corresponding line in view file:

<?php echo $this->widget('application.extensions.juidatepicker.EDatePicker',
array(
'name'=>'Day',
    'value'=>$this->Filter['fromDay'],
    'language'=>'de',
    'mode'=>'focus',
    'dateFormat'=>'dd.mm.yy',
    'fontSize'=>'1em',
    'options'=>array(
    'rangeSelect'=>'true',
    'firstDay'=>'1',
    ), 
));?>


I am using the newest Version 1.8.
May be you can take a look if you have the time....

Thank you!

Greetings from Germany
me23
0

#33 User is offline   MetaYii 

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

Posted 15 January 2009 - 10:39 AM

Quote

I've just got datepicker working, and i can set the fontSize in the view, but shouldn't it be possible to set it in the config file, so it would be set site wide?


Hi, do you mean in the application configuration?
0

#34 User is offline   MetaYii 

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

Posted 15 January 2009 - 01:59 PM

Quote

i've got a new issue, by trying to set 'rangeSelect' in options, it seems that the options will be overwritten in Line 546:




if ($this->mode !== 'advanced') {
    $this->options = $this->makeOptions($baseUrl);
}


Hi me23, sorry for the late answer, I didn't see you post before. Actually the "advanced" mode was a bit redundant, so I opted to not to include it in 1.9. Better yet, the user's options now take precedence over the "templates". Take a look  8)
0

#35 User is offline   ilzale 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 113
  • Joined: 08-October 08

Posted 16 January 2009 - 04:37 AM

great job, I would like to suggest:

the TIMESTAMP mode is very useful if you are using db dates as integer to be abstracted from the date format of the daabases (mssql, mysql, etc..). I usually use to treat dates al bigint and put inside unix timestamps.

this datepicker has the option to use TIMESTAMP but the little problem is that in this mode in textbox appear unix seconds and this is not very nice to see.

I was thinking if there is a way to post the unix timestamp but to see a normal date in textbox.
0

#36 User is offline   MetaYii 

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

Posted 16 January 2009 - 09:28 AM

Quote

this datepicker has the option to use TIMESTAMP but the little problem is that in this mode in textbox appear unix seconds and this is not very nice to see.

I was thinking if there is a way to post the unix timestamp but to see a normal date in textbox.

Hmm, let me check, because I don't think its possible to do this directly with the datepicker jquery widget, because the presentation in the textfield is the same as in the corresponding $_POST... that's the idea behind the format selector.

Anyway, you could use the time extension or PHP's [tt]time[/tt]/[tt]mktime[/tt]/[tt]date[/tt] to convert the date from and to unix timestamps so you can use a nice format in your form and store them as timestamps in your database.
0

#37 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 16 January 2009 - 11:26 AM

strtotime() is also a real helper here.

Quote

strtotime — Parse about any English textual datetime description into a Unix timestamp

0

#38 User is offline   MetaYii 

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

Posted 16 January 2009 - 11:27 AM

Quote

strtotime() is also a real helper here.


You're right Mikl, I forgot that one.
0

#39 User is offline   ilzale 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 113
  • Joined: 08-October 08

Posted 18 January 2009 - 08:37 AM

yes, obviously i can use all of this php functions to do what i want with date but in my opinion should be good if you don't have to change nothing in the related controller to translate the $_POST values in something you will save in db.

anyway this is a solution.
0

#40 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 22 January 2009 - 06:07 AM

Good news, about the advanced options, thanks. But where's the download gone  ???. Can i find 1.9 somewhere else?


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