?
avatar lyquix-owner
lyquix-owner
29 Aug 2016

A frequent request from Joomla users is to make the calendar picker better. The request can be summarized in 3 areas:

  • Looks: the current calendar picker looks dated and it is hard to use in touch screens
  • Ability to pick time: the picker only allows to pick a date, not time, even when the value includes time
  • Display human-friendly format: the date-time value displayed in the text field is formatted according to the field settings, which are normally intended for machine reading or database storage

I noticed there is PR that addresses the issues with looks and compatibility but doesn't seem to address the other issues.
#11138

I have worked on an option that I submit to your for consideration:
https://github.com/Lyquix/plg_system_datetimepicker/releases

This plugin replaces the default Joomla date picker with good-looking and full-featured Bootstrap Datepicker from https://eonasdan.github.io/bootstrap-datetimepicker/

It separates presentation/display format from data/DB format. A input text field without name attribute is used for display purposes only, while a hidden field holds the value that is passed back to the server.

Supports all Joomla date-time format strings as specified in https://github.com/joomla/joomla-cms/blob/staging/media/system/js/calendar-uncompressed.js#L1741-L1774

The plugin has several options and configuration settings. Please play with it.

I have not yet integrated it with Joomla locale. MomentsJS has support for locale but their naming convention doesn't match Joomla's, so it will require some extra work.

avatar lyquix-owner lyquix-owner - open - 29 Aug 2016
avatar dgt41
dgt41 - comment - 29 Aug 2016

@lyquix-owner have you really checked #11138 ?

It has all the options mentioned above plus
it is B/C
it supports persian (and other calendars)
Also is vanilla javascript instead of requiring jQuery and bootstrap.js

But if you feel that one is a better approach please create a PR and let me just close the other one.

avatar lyquix-owner
lyquix-owner - comment - 29 Aug 2016

No, don't close your PR, please. Your work looks amazing and I am trying to contribute ideas to build on it. From reading it didn't look like it supported time picking, or custom formats, but I will check it again.

avatar brianteeman
brianteeman - comment - 29 Aug 2016

from looking at the code it seems a bit odd to have to go through a date
format conversion from php defaults to something else

On 29 August 2016 at 17:21, Dimitri Grammatikogianni <
notifications@github.com> wrote:

It does:
https://cloud.githubusercontent.com/assets/1296369/17887343/e8cfad44-
691d-11e6-8705-882b8d195383.png


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#11837 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8cMObr7iC4sZEW55WejpsinX-8kcks5qkwcngaJpZM4Jvn6S
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar lyquix-owner
lyquix-owner - comment - 29 Aug 2016

@brianteeman: the conversion is from Joomla date-time format into MomentJS, because the date picker I am using relies on MomentJS. It seems to me that some form of format conversion will be always needed because we need to talk between Joomla date-time format and Javascript.

avatar brianteeman
brianteeman - comment - 29 Aug 2016

It is not a joomla date time format it is native php

On 29 August 2016 at 17:31, lyquix-owner notifications@github.com wrote:

@brianteeman https://github.com/brianteeman: the conversion is from
Joomla date-time format into MomentJS, because the date picker I am using
relies on MomentJS. It seems to me that some form of format conversion will
be always needed because we need to talk between Joomla date-time format
and Javascript.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#11837 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8VClsGkPLCFsdk6zvRtnG34qNgm3ks5qkwlMgaJpZM4Jvn6S
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar lyquix-owner
lyquix-owner - comment - 29 Aug 2016

Not according to the documentation: https://docs.joomla.org/Calendar_form_field_type

The format attribute specifies the format that the date string will be saved in. It is also the format that manually entered dates need to be enterered in; except that the punctuation character is ignored. The coding scheme used to specify date formats is a custom one defined for the javascript library used in the datepicker, full details of which can be found for example on Joomla's Github.

Even if it is PHP strftime or date formats, we need some format conversion for it work with JS. But in any case I don't think it is worth our time discuss about that. Isn't it?

Is there a way for me to get the files you modified in your PR? I don't have write permissions in this repo, and I don't know a way to checkout the PR into my fork (pardon my ignorance). That's why I relied only on the PR descriptions and it wasn't clear to me that it included the suggestions I mention in this Issue.

avatar brianteeman
brianteeman - comment - 29 Aug 2016

https://docs.joomla.org/Testing_Joomla!_patches

On 29 August 2016 at 18:04, lyquix-owner notifications@github.com wrote:

Not according to the documentation: https://docs.joomla.org/
Calendar_form_field_type

The format attribute specifies the format that the date string will be
saved in. It is also the format that manually entered dates need to be
enterered in; except that the punctuation character is ignored. The coding
scheme used to specify date formats is a custom one defined for the
javascript library used in the datepicker, full details of which can be
found for example on Joomla's Github.

Even if it is PHP strftime or date formats, we need some format conversion
for it work with JS. But in any case I don't think it is worth our time
discuss about that. Isn't it?

Is there a way for me to get the files you modified in your PR? I don't
have write permissions in this repo, and I don't know a way to checkout the
PR into my fork (pardon my ignorance). That's why I relied only on the PR
descriptions and it wasn't clear to me that it included the suggestions I
mention in this Issue.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#11837 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8cDL210cm4FmNaUmHW2P9IwE-N6sks5qkxEOgaJpZM4Jvn6S
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar zero-24 zero-24 - change - 30 Aug 2016
Category Feature Request Fields
avatar brianteeman brianteeman - change - 2 Sep 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-09-02 11:13:08
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 2 Sep 2016

I am closing this as we have a PR already #11138 and if you wish to improve on that you can do so there

avatar brianteeman brianteeman - close - 2 Sep 2016
avatar brianteeman brianteeman - close - 2 Sep 2016
avatar brianteeman brianteeman - change - 5 Sep 2016
Labels Added: ?

Add a Comment

Login with GitHub to post a comment