Jump to content


Grocery CRUD Enterprise date and datetime fields


  • Please log in to reply
12 replies to this topic

#1 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,144 posts
  • LocationLondon

Posted 17 October 2017 - 09:13 PM

Hello All,

 

As I am getting lot of emails and questions about date and datetime fields for Grocery CRUD Enterprise, I thought that it would be good to have an explanation about why Grocery CRUD Enteprise has took some different decisions for the dates from the community one. What mistakes did we make and why and what we will do at the future about it. So let's answer some questions:

 

Why you did change the dates from grocery CRUD community Johnny?

 

Many people was wondering why to change the dates from Community edition when it is already too good and it has the below features:
- date format can be specified by the developer
- the language of date is in the main language chosen from grocery CRUD
- the input looks the same for all the browsers

The answer for that is that I wanted to take it one step further. So the main reason that I did it was:

- date format is specified by the OS (e.g. Windows) of the user. So that mean that if the user for any reason want to change the format, it can happen by changing the format at his laptop/PC
- the UI/UX of the type date and datetime it is just amazing and really easy to use. Moreover you are familiar with it.

- the implementation is very easy and that means that it needs much less code in order to implement it

- we will always have the fallback of jQuery UI in case that the browser does not support it but I thought that very soon all the browsers will have them

- full mobile compatible. I think an image will convince you for that: https://mdn.mozillad...-picker-fxa.png
- no need for extra translation of the days/months... e.t.c. as the input type date support all of that

The thing is that I saw users complaining about format and I have to be honest I didn't thought about some simple things:

- the language of the keyboard may be in English so the user will see English days instead of their native language
- famous browsers such us firefox and safari doesn't have in their plans to include input type date :(
- the transformation of the date in the columns is a bit unstable

- the developer wants to specify the date format so users will not be confused when they are traveling.

ok. So now that you saw there are some issues, what are your next steps?

 

I wanted to focus to other small bugs (not related with dates) and I didn't have the time to change the behaviour of date and datetime as it is really time consuming. The good news is that I've already answer with some work-arounds at the forums and don't get me wrong but for most of the users the date issues was not even noticeable. The only exception is the search of the dates that was frustrated (and noticeable) but now at the latest version (2.3.7) the column search for date and datetime has been improved as well. So what I am saying is that I can understand your urgency from your bosses/customers ( I really do!) but I really prefer to take my time and do it right rather than rush it and produce  extra bugs.

When are you going to do the changes that you are mentioning above?

 

Now for this I can't commit to any date just yet but this is now my next priority. If you would like to get informed once this new version is available please right a comment below with a "+1".

 

Thank you all for the feedback that I am getting for Grocery CRUD Enterprise as it is very positive and it also helps me improve the product.

 

Happy GCing :)
 

 

 

 


Posted Image

#2 wildfandango

wildfandango

    Member

  • Members
  • PipPip
  • 24 posts

Posted 19 October 2017 - 09:24 PM

+1



#3 larasmith

larasmith

    Advanced Member

  • Members
  • PipPipPip
  • 199 posts
  • LocationPhilippines

Posted 23 October 2017 - 05:19 AM

+1



#4 revup

revup

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 24 October 2017 - 08:41 PM

How do you input YYYY-mm-dd, same as php date('Y-m-d')?

 

NOTE: This should be a "must have" feature as most mysql databases store the dates as YYY-mm-dd and this makes the UI a lot more compatible.



#5 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,144 posts
  • LocationLondon

Posted 25 October 2017 - 07:14 AM

Hello All,

 

The development of the date and datetime fields is currently in progress at the moment and this is the number one priority. I am going to refactor the way that the date works and I will implement it with the  same way as Grocery CRUD Community. Please be patient till the next version. I will update you once this feature is available.

 

Regards

Johnny


Posted Image

#6 Marty

Marty

    Member

  • Members
  • PipPip
  • 11 posts

Posted 25 October 2017 - 10:06 AM

Hi Johnny,
 
Concerning the refactoring I updated to 2.3.7. but now the search field for the dates are "way" to wide, creating wide date and datetime columns in relation to the column content, squeezing other columns into undesirable small widths.
 
Hope you can address this issue as well in the refactoring-process.
 
Regards,
Marty


#7 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,144 posts
  • LocationLondon

Posted 25 October 2017 - 12:21 PM

Hello Marty,

 

As the refactoring is still in progress I will also have this in mind.

 

Regards

Johnny


Posted Image

#8 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,144 posts
  • LocationLondon

Posted 02 November 2017 - 05:38 AM

All of the above just mentioned are now live within the version 2.4.0. Exciting release and a big one (don't worry full backward compatible!) More specifically in this release we have:

2.4.0
- GC-229: Add the ability for the developer to choose a unique date format and input for all browsers.
- GC-242: Update to React Fiber (version 16)  :wub: 
- GC-240: Cover basic concepts so bootstrap v4 CSS will not break.
- GC-244: transfer all the jquery extra headers to the upload library as well (useful for CSRF and cross origin requests)

The only thing that you will need to have is this extra line at your config:
 

// There are only three choices: "uk-date" (dd/mm/yyyy), "us-date" (mm/dd/yyyy) or "sql-date" (yyyy-mm-dd)
'date_format' => 'uk-date',

I did also updated the documentation. 

Happy GCing  :D

 

Johnny


Posted Image

#9 larasmith

larasmith

    Advanced Member

  • Members
  • PipPipPip
  • 199 posts
  • LocationPhilippines

Posted 07 November 2017 - 07:04 AM

All of the above just mentioned are now live within the version 2.4.0. Exciting release and a big one (don't worry full backward compatible!) More specifically in this release we have:

2.4.0
- GC-229: Add the ability for the developer to choose a unique date format and input for all browsers.
- GC-242: Update to React Fiber (version 16)  :wub: 
- GC-240: Cover basic concepts so bootstrap v4 CSS will not break.
- GC-244: transfer all the jquery extra headers to the upload library as well (useful for CSRF and cross origin requests)

The only thing that you will need to have is this extra line at your config:
 

// There are only three choices: "uk-date" (dd/mm/yyyy), "us-date" (mm/dd/yyyy) or "sql-date" (yyyy-mm-dd)
'date_format' => 'uk-date',

I did also updated the documentation. 

Happy GCing  :D

 

Johnny

 

Dear Sir Johnny,

 

Adding the symbols: >,< to filter dates work but once the focus is out of the search area,

only the exact date and time is returned so it hinders the input of the

filters to broaden the search.

 

Kindly check.

 

Thanks!

 

Lara



#10 wildfandango

wildfandango

    Member

  • Members
  • PipPip
  • 24 posts

Posted 07 November 2017 - 08:30 PM

All of the above just mentioned are now live within the version 2.4.0. Exciting release and a big one (don't worry full backward compatible!) More specifically in this release we have:

2.4.0
- GC-229: Add the ability for the developer to choose a unique date format and input for all browsers.
- GC-242: Update to React Fiber (version 16)  :wub: 
- GC-240: Cover basic concepts so bootstrap v4 CSS will not break.
- GC-244: transfer all the jquery extra headers to the upload library as well (useful for CSRF and cross origin requests)

The only thing that you will need to have is this extra line at your config:
 

// There are only three choices: "uk-date" (dd/mm/yyyy), "us-date" (mm/dd/yyyy) or "sql-date" (yyyy-mm-dd)
'date_format' => 'uk-date',

I did also updated the documentation. 

Happy GCing  :D

 

Johnny

 

Hi Johnny

 

I have set the date format as uk-date because in my country (Spain) the dates are written in dd/mm/yyyy format.

 

But now the calendar shows as the first day of the week on Sunday when in my country the first day of the week is Monday ... is it possible to solve this?

 

thx in advance

I have set the date format as xxx because in my country (Spain) the dates are written in dd / mm / yyyy format but now I have the problem that the calendar shows as the first day of the week on Sunday when in my country the first day of the week is Monday ... is it possible to solve this?

 

screenshot > https://drive.google...iew?usp=sharing



#11 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,144 posts
  • LocationLondon

Posted 08 November 2017 - 06:00 AM

Hello @wildfandango,

 

At your JavaScript code (just make sure that it is after the load of grocery CRUD) you can add your own preferences as default behaviour of the calendar like this:
 

$.datepicker.setDefaults({
            firstDay: 1 // Starts on Monday
});

You can change any of the options from the documentation of jQuery Datepicker here: https://api.jqueryui....8/datepicker/ 

 

Enjoy  :D 
Johnny


Posted Image

#12 wildfandango

wildfandango

    Member

  • Members
  • PipPip
  • 24 posts

Posted 08 November 2017 - 08:02 PM

It has worked perfectly!

 

thx a lot!



#13 rkrajnik

rkrajnik

    Member

  • Members
  • PipPip
  • 28 posts

Posted 26 July 2020 - 07:59 PM

+1






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users