Answers.Body: <p>I think "year only" widgets could be improved in CiviCRM. Until that happens, you might be better off with a custom field of type "number".</p>
  
  <p>In the webform you can specify a minimum and maximum amount to limit it to reasonable years.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-16T05:06:44.130Z
Answers.Text: oh yep. that really sucks still. hmm
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-16T11:54:03.937Z
Answers.Text: I thought it was better now.
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-16T21:03:16.883Z
Answers.Text: we are seeing similar issue on dmaster, calendar icon which doesn't function. click up/down selector for year which is pretty painful
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-19T22:12:28.723Z
Answers.LastActivityDate: 2015-11-19T22:12:28.723Z
Answers.UserDisplayName: Coleman
Answers.Body: <p>You can achieve this in Webform by hiding the day and month fields as well as deselecting the enable pop-up calendar option on the webform component.  There you can also set how far back you'd like the years to go.</p>
  
  <p>However, Civi still stores the entire date.  I believe the date will be stored as Today's date, 2015 12:00 am if you select 2015 for example.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-20T20:22:31.447Z
Answers.Text: It looks like I can do that when adding a new non-CiviCRM field, but for some reason it looks like I don't have the ability to edit components that are tied to CiviCRM. I thought maybe they couldn't be edited if they had data attached to them but I went and cleared my test submissions but it still didn't put the edit button next to them in the Webform tab. Am I doing this wrong or something?
Answers.UserDisplayName: A.J.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-20T20:29:59.160Z
Answers.Text: Scratch that. Found out that I'm just a version behind based on this: http://civicrm.stackexchange.com/questions/7541/drupal-webform-missing-edit-link-for-fields-from-civicrm-database
  
  Using a newer version made the edit links show up. Thank you, sir!
Answers.UserDisplayName: A.J.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-19T21:36:02.427Z
Answers.LastActivityDate: 2015-11-19T21:48:31.180Z
Answers.LastEditDate: 2015-11-19T21:48:31.180Z
Answers.UserDisplayName: pmoz
Body: <p>To preface this, I'm using CiviCRM's integration on Drupal 7, with the Webform integration module.</p>
  
  <p>I'm looking to store a number of custom fields as a year. It appears that I am able to use the Date field type to store a date in the format of "YYYY", which sounds like what I want to do. However, the widget that is presented to the user to input the data requires you to choose a specific date from a date picker rather than a year, even if it only stores the year. </p>
  
  <p>On top of that, when I use the Webform module integration with CiviCRM, the widget that I am presented with has 3 dropdowns, one for month, one for day, and one for year. </p>
  
  <p>Ideally both the backend widget and the Webform widget would simply be a select box that allows you to pick only the year starting about 60 years back and ends 20 years in the future. I'm sure I could just make a select box to do just that, but I don't want to manually edit the values in a select box just to get a simple date field.  </p>
  
  <p>Does anyone know if there is a way to handle this the way I'm describing or am I stuck using a full date field to simply store a year?</p>
  
Tags: <drupal><webform-civicrm><dates>
Title: Is there an accepted standard for storing data as a year?
ThreadText: # Is there an accepted standard for storing data as a year?
  
  (Asked by: username_0 on 2015-11-19)
  
  To preface this, I'm using CiviCRM's integration on Drupal 7, with the Webform integration module.
  
  I'm looking to store a number of custom fields as a year. It appears that I am able to use the Date field type to store a date in the format of "YYYY", which sounds like what I want to do. However, the widget that is presented to the user to input the data requires you to choose a specific date from a date picker rather than a year, even if it only stores the year.
  
  On top of that, when I use the Webform module integration with CiviCRM, the widget that I am presented with has 3 dropdowns, one for month, one for day, and one for year.
  
  Ideally both the backend widget and the Webform widget would simply be a select box that allows you to pick only the year starting about 60 years back and ends 20 years in the future. I'm sure I could just make a select box to do just that, but I don't want to manually edit the values in a select box just to get a simple date field.
  
  Does anyone know if there is a way to handle this the way I'm describing or am I stuck using a full date field to simply store a year?
  
  **Tags:** drupal, webform-civicrm, dates
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2015-11-19. Score: 1 | Accepted answer
  
  You can achieve this in Webform by hiding the day and month fields as well as deselecting the enable pop-up calendar option on the webform component. There you can also set how far back you'd like the years to go.
  
  However, Civi still stores the entire date. I believe the date will be stored as Today's date, 2015 12:00 am if you select 2015 for example.
  
  > **Comments:**
  > **username_0**: It looks like I can do that when adding a new non-CiviCRM field, but for some reason it looks like I don't have the ability to edit components that are tied to CiviCRM. I thought maybe they couldn't be edited if they had data attached to them but I went and cleared my test submissions but it still didn't put the edit button next to them in the Webform tab. Am I doing this wrong or something?  
  > **username_0**: Scratch that. Found out that I'm just a version behind based on this: http://civicrm.stackexchange.com/questions/7541/drupal-webform-missing-edit-link-for-fields-from-civicrm-database  Using a newer version made the edit links show up. Thank you, sir!  
  
  ---
  
  ### Answer by username_1 on 2015-11-19. Score: 1
  
  I think "year only" widgets could be improved in CiviCRM. Until that happens, you might be better off with a custom field of type "number".
  
  In the webform you can specify a minimum and maximum amount to limit it to reasonable years.
  
  > **Comments:**
  > **username_2**: oh yep. that really sucks still. hmm  
  > **username_1**: I thought it was better now.  
  > **username_2**: we are seeing similar issue on dmaster, calendar icon which doesn't function. click up/down selector for year which is pretty painful  
  
  ---
  
  