[Phpmyadmin-devel] Zoom-search and dates

Ammar Yasir ayax88 at gmail.com
Tue Aug 2 19:25:11 CEST 2011


On Tue, Aug 2, 2011 at 10:24 PM, Marc Delisle <marc at infomarc.info> wrote:

> Ammar,
>
> Zoom-search of date values needs improvement. Here is an example table:
>
> CREATE TABLE IF NOT EXISTS `birthday` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `name` varchar(50) NOT NULL,
>   `birthday` date NOT NULL,
>   PRIMARY KEY (`id`)
> ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
>
>
> INSERT INTO `birthday` (`id`, `name`, `birthday`) VALUES
> (1, 'A', '1950-01-01'),
> (2, 'B', '1950-02-02'),
> (3, 'C', '1960-03-03'),
> (4, 'D', '2000-04-04');
>
> Generating a plot via zoom-search show that the same time elapsed
> between two days (in 1950) than in ten or forty years.
>
> If you could convert these dates to a number of days (probably at the
> Javascript layer), the same way than in MySQL [0], you would get
> meaningful results. Of course you still need to display the unconverted
> date value.
>
> [0]
>
> http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_to-days
>
> I looked up in the reference manual and I think Highcharts will do that
automatically ( calculate distance between dates) if we can convert the date
into specific format, like the *dateFormat* function specified [0] will
probably work.
I'll need to have cases for each of the date and time types in MySQL [1] (
format to be chosen accordingly, like for datetime: '%e. %b %Y, %H:%M:%S'
and for year: ' %Y ' only)

[0] http://www.highcharts.com/ref/#highcharts-object
[1] http://dev.mysql.com/doc/refman/5.0/en/date-and-time-types.html

--
> Marc Delisle
> http://infomarc.info
>
>
> ------------------------------------------------------------------------------
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> _______________________________________________
> Phpmyadmin-devel mailing list
> Phpmyadmin-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20110802/a0c69291/attachment.html>


More information about the Developers mailing list