Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7173461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:49:43+00:00 2026-05-28T15:49:43+00:00

I need formtastic to display only month and year fields, WITHOUT the day fields.

  • 0

I need formtastic to display only month and year fields, WITHOUT the day fields.

The datepicker is nice but it shows the whole calendar. I don’t want the datepicker.
f.input :accounting_month, :label => "Accounting month", :as => :datepicker

All I need is the month and year.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:49:45+00:00Added an answer on May 28, 2026 at 3:49 pm

    It doesn’t work that way because without day this implies 28-31 (depending on month) days and it could be any one of them. If you use want to store a month-year selection without day you’ll see it is a range of dates, not “a” date.

    Advice with dates is to always store the whole date as a date field. If you only know month and year you’ll need to have two (non-date) fields, one for each. But as you can see it’s going to lose you a lot and you’ll need to custom craft each field, validate it, etc. major pain so needs pretty good reason to do it..

    The only other thing I can suggest is:
    create a hidden div, or apply css if you can’t ‘get inside’ the standard date field on the form, for the ‘day’. Then set the value to always be 01. Then you might have a ‘date’ set of fields that will save 01-month-year to the database. This is definitely a ‘hack’!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need to an expression that returns only things with an I followed by either
f.input :some_model_values, :as => :select Using Formtastic, I need to set a text for
I am using farbtastic color picker and working fine but now I need to
For me to use formtastic, it looks like I need this as my html
I am trying to setup a simple form using formtastic but running into a
Forms offer no differentiation value for your service, but most web sites need them
I have a list of vendors. I need to put them in a formtastic
Need prettier solution of below example but with std::accumulate. #include <algorithm> #include <vector> #include
I need to use Active_admin with Formtastic 2 and the main branch doesn't support
I need to pass a collection to the standard select input in Formtastic: f.input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.