开发者

Is there a simple-to-implement datepicker for Symfony?

I'm working on a site in Symfony that displays graphs of a range of metrics. Currently I'm trying to implement a simple datepicker to decide what graph to show.

Preferably in one of these forms:

  • a simple calendar icon that presents a calendar when clicked
  • three drop-downs for the day, month and year

The latter only as a plan-b really, the first would be great.

Now, I'm new to Symfony and I'm quite spoiled. Everything I wanted so far has always been but a plugin/helper/tag away. I sort of hoped that it was the same for a date-picker like this one, but so far I'm coming up empty. There are a few possibilities, but they all require a crap-load of dependencies and seem to have a low success-rate with people who have tried to implement 开发者_如何学运维them.

I have the feeling that I'm overlooking something that's right in front of me. So in short: what is, according to you guys, the simplest way to implement such a date picker in Symfony? And if you have one, do you have a link with a clean and clear explanation?

Thanks a bunch,

Dieter


I use sfWidgetFormJQueryDate widgets based on jquery-ui from sfFormExtraPlugin.

class YourFormFilter extends BaseYourFormFilter
{
  public function configure()
  {
    $date_widget = new sfWidgetFormJQueryDate(array(
      'date_widget' => new sfWidgetFormDate(array('format' => '%day%/%month%/%year%')),
      'culture' => 'ru'
    ));
  }
}


Check this one, it is intended for Syfmony2

http://blog.azancadas.com/2011/07/symfony2-datepicker/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜