I'd like to have control over granularity of the various parts of the date/time field. For example, show only month and year in select list dropdowns.

The date field stored in the DB would, obviously, be a complete date, so devs would need to be able to specify defaults for the missing parts. In the month/year example, one might want to have "day" default to the first day of the month, or the last day of the month. Or if "year" was the omitted part, it could default to the current year.

Comments

Comment #1

ExTexan created an issue. See original summary.

heddn’s picture

Comment #2

heddn
Primary language English
Location Illinois
commented
Version: » 8.x-1.x-dev
StatusFileSize
new datetime_extras-add_granularity_options-2823764-2.patch 1.87 KB

Just a stub, but something to start with. Right now it will just return the same thing as the normal select list widget.

heddn’s picture

Comment #3

heddn
Primary language English
Location Illinois
commented
Status: Active » Needs review
StatusFileSize
new datetime_extras-add_granularity_options-2823764-3.patch 2.46 KB
new interdiff_2-3.txt 1.76 KB
1 file was hidden/shown/deleted

OK, let's see what happens when we do this.

heddn’s picture

Comment #4

heddn
Primary language English
Location Illinois
commented
StatusFileSize
new interdiff_3-4.txt 323 bytes
new datetime_extras-add_granularity_options-2823764-4.patch 2.56 KB
2 files were hidden/shown/deleted
StatusFileSize
hidden datetime_extras-add_granularity_options-2823764-3.patch 2.46 KB
hidden interdiff_2-3.txt 1.76 KB

composer packages aren't getting built. We might have to just commit this thing with the updates to the .info file.

Comment #5

  • heddn committed dc6c0d4 on 8.x-1.x
    Issue #2823764 by heddn, ExTexan: Add granularity options
    
heddn’s picture

Comment #6

heddn
Primary language English
Location Illinois
commented
Status: Needs review » Fixed

If there's any bugs in this, we can fix them in follow-ups. I want to get composer functional.

Comment #7

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.