Only local images are allowed.

Can't seem to be able to add animals and specify a birth date earlier than 2014. Maybe we could either override the 'year' drop down menu with a text box entry (validation issues?) or use a pop-up calendar.

.... .farmos.net/farm/asset/add/animal?destination=farm/assets/animals

Not sure of version - hosted on Farmier.

Issue fork farm-2906277

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

EagleViewFarm created an issue. See original summary.

m.stenta’s picture

Ah good catch! The birthdate field should have a wider range than -3 +3 years.

I fixed that on your site specifically - give it a try now and you should be able to go up to back 10 years.

I'll add this to the roadmap for the next release so that it is fixed permanently for everyone.

Thanks for the bug report!

  • m.stenta committed 82d29d8 on 7.x-1.x
    Issue #2906277: Can't enter new animal birth dates before 2014
    
m.stenta’s picture

Title: Can't enter new animal birth dates before 2014 » Animal birth date limited to 10 years ago

I committed a change which increases the date range from -3 +3 to -10 +3. This is the maximum that the date field supports it seems.

I think we'll want to find a better solution to this. 10 years will probably work in most cases, but I'd rather not have a limit, if possible.

Renaming this issue - I'll look into it in more detail soon...

Anonymous’s picture

Great! Very encouraging for my first bug report :) That works for the couple I was working on. Still have productive ewes born in 2005-2006 and horses well before that (16+ yrs). I'm guessing that there maybe other farming enterprises that might have animals in that age range (breeding stock etc.) so it will be good to have it fixed in the next release. Good process.

m.stenta’s picture

Ok actually, it looks like it is possible to set it to more than 10 years. I set it to 100. So that should allow you to enter all your birthdates.

I'd still like to give this a little thought before considering it "fixed". Ultimately farmOS needs to be able to handle ANY dates. And the fact that the year selection widget range changes relative to the current year is not ideal (this year the range is 1917-2020, next year it's 1918-2021, etc).

m.stenta’s picture

Title: Animal birth date limited to 10 years ago » Date widget range limited to 10 years ago
Component: Farm Animals » User interface

Also, we will want to make the same change to other date fields in farmOS - not just animal birth dates. I'm generalizing this to the "User interface" component and updating the title again.

Anonymous’s picture

That's great. Works well at 100 years. I was thinking last week that the ability to list the lineage of animals means that breeders may enter details of breeding stock further back than their current herd. So it's a good change.

m.stenta’s picture

sdutcher’s picture

That date/time widget looks snazzy. I especially like the inline style. Thinking of incorporating that all around?

m.stenta’s picture

@sdutcher - Yes potentially. I'd like to find something that can be implemented consistently in all of farmOS.

There are a couple of key requirements:

- Needs to support any date, ideally (no limit on the year range).
- Needs to be easy to use on mobile devices, small screens.
- Needs to not introduce more dependencies that block the farmOS Drupal 8 upgrade.

Currently we're using the Date module's "Select" widget everywhere, which presents the user with dropdown select fields for year, month, day (and in some contexts, hour and minute). This is very easy to use on mobile devices, because they provide a nice UI for select fields out-of-the-box, and it's easy to change one (ie: month) without touching the other ones (ie: if you are rescheduling something to next month). The major limitation is that the "year" dropdown must have a pre-defined range of options. So the easiest thing we could do to fix this particular issue is increase the range of that select list. But the question is: does that make it harder to use (when it has a HUGE list of options going back 50+ years).

The other option is to look for a different widget type, and that's where the Bootstrap Date and Time Picker might be a good option. It does add another dependency, though, which means more code we would need to upgrade for Drupal 8. I would also like to experience how it works on mobile to compare against what we currently have.

sdutcher’s picture

@m.stenta - I had altered the year filter to go back 100 years, and yes it did make it more tedious to set/change dates.

I went ahead and integrated Bootstrap Date and Time Picker into my installation. There were hurdles, the documentation from the author is lacking some info but user posts filled the gaps. Not many modifications were needed to get the module to work; log.module, log.pages, farm_crop.module. The changes were something like:

  $form['timestamp'] = array(
    '#type' => 'date_text',
    '#title' => t('Date'),
    '#default_value' => $timestamp_default,
    '#bdtpicker' => TRUE,
    '#datepicker_options' => array(),    // This is where we customize the widget
    );

If you'd like, I can give you access to my farmOS installation so you can check it out. It's at https://www.shone.farm

m.stenta’s picture

Status: Active » Closed (outdated)

I'm going to close this - we are working on farmOS 2.x, on Drupal 9, which has new date field widget options we can explore when we get to that point. This will be done in: #3151246: [META] farmOS 2.x UI/UX

EvilArgest made their first commit to this issue’s fork.