techutopia
Total posts: 202
13 Oct 2016 10:27

Hi all,

In the config of this field, I can see "Edit values" and "Load data" General Parameters, but not a "SQL values source" or other such 'live' data option.

I am using the multiple select for picking ...

Century > Decade > Year > Month > Day

I can add all this data as an import, but I'd then need to add todays date every day, and I don't want to offer people the choice of a day in the future.

If anybody has any thoughts as to how I would do this it would be much appreciated.

Thanks,

Dale.

Last Modified: 17 Nov 2016


techutopia
Total posts: 202
13 Oct 2016 11:53

I have created a little script that outputs all the data required if I have to use it in the 'Load data' box.

It results in a huge file ... it uploads up to 100% but then just crashes unfortunately.

Dale.


techutopia
Total posts: 202
19 Oct 2016 08:09

In summing up ...

I need a field that will allow a user to pick a date or part date.

Century > Decade > Year > Month > Day

i.e. if they know a century, offer a choice of decade, if they know decade, offer a choice of year etc. etc.

Only century will be required.

I have tried chaining select fields, but it's a little clumsy, and couldn't get it to work.

I purchased multi level select and it seems to be the right tool, but there's no live data import, and if I upload a data file to it it crashes out (it is a large data file to be fair).

Even if the above is working, I'd still end up with data from the database that would be out of date for the next day after upload/import.

So, maybe my next move is to edit the multi level select field ... maybe public function _getList($post, $all = FALSE)? Unless anyone else has some good ideas?

Thankyou.

Dale.


Sergey
Total posts: 13,748
20 Oct 2016 12:33

What I would recommend you is to have 2 fields.

  1. Multiple level select with Century->Deacade
  2. Date And Time with year->month->day. There is input template like this.

It would be even more flexible. For example I want to see all PPL from 1 September through all centuries. that would never be possible in your current setup.


techutopia
Total posts: 202
20 Oct 2016 20:47

Hi Sergey,

Thankyou for you reply. I appreciate it.

I understand what you're saying about flexibility.

So if someone picks, say, 2000's and 2010-2019 (for century and decade), how would I make 'Date and Time' only offer choices for the years 2010, 2011, 2012 etc. to 2019?

Also, if I make decade optional (as someone may not know this), they only know the century, then somehow I'd need to disable the date and time field altogether?

Thanks again. :-)

I know this is probably a unique scenario, so I really do appreciate your posted thoughts.

Dale.


Sergey
Total posts: 13,748
28 Oct 2016 03:58

techutopia So if someone picks, say, 2000's and 2010-2019 (for century and decade), how would I make 'Date and Time' only offer choices for the years 2010, 2011, 2012 etc. to 2019?

Oh! here is how you what it to work.

I think you can do that with JS. Add jQuery script to custom form template or to cutom date and time field input template and change content of YEAR selector based on sentury field.

Do you have jQuery skill?


techutopia
Total posts: 202
31 Oct 2016 11:57

Hi,

Well, I can always learn something - I hope. :-)

As the user may not know a year, month or day, does the date field allow each of year month and day to be optional?

I have not purchased the field, and I can't get info. on documentation.

e.g. for YYYY-MM-DD

allows??? ...

All empty.

YYYY-empty-empty

YYYY-MM-empty

YYYY-MM-DD

Thanks again,

Dale.

:-)


Sergey
Total posts: 13,748
08 Nov 2016 10:45

You can only enter all of YYYY-MM-DD. No empty allowed. It is calendar and you have to select final day.

If you want only YYYY-MM for example, Then you can use another select field. Or 2 fields.


techutopia
Total posts: 202
15 Nov 2016 10:30

Thanks for replies.

It seems that the answer is ...

a) Have a dropdown for each of Century, Decade Year, Month and Day b) Make Century mandatory. c) Chain them together with Jquery - e.g. If Century is chosen, then populate Decade with appropriate choices. d) Make Century visible, the rest invisible. e) If a century is chosen, make Decade visible, and so forth for the rest of the fields.

Dale.


Sergey
Total posts: 13,748
17 Nov 2016 06:51

Something like this.

Powered by Cobalt