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 9152107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:57:46+00:00 2026-06-17T11:57:46+00:00

I have a DatePicker where I disabled the SpinnerView and now only use the

  • 0

I have a DatePicker where I disabled the SpinnerView and now only use the CalendarView. But it starts with the sunday and I would like to use monday as the first day of the week. How can I change that? I guessed that the first day would depend on the phones settings but on my swiss phone its still wrong…

I haven’t found any set Method or any XML command.

<DatePicker
   android:id="@+id/date_picker"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_alignParentLeft="true"
   android:layout_alignParentRight="true" />

and

DatePicker datePicker = (DatePicker)   convertView.findViewById(R.id.date_picker);
datePicker.setSpinnersShown(false);

————EDIT:————

I tried to change the locale:

Locale.setDefault(Locale.GERMAN);

But that didn’t change anything ether. So I read the android-17.android.widget.DatePicker.java where I found out:

public DatePicker(Context context, AttributeSet attrs, int defStyle) {
  //...  
  // initialization based on locale
        setCurrentLocale(Locale.getDefault());
  //...
}


 /**
 * Sets the current locale.
 *
 * @param locale The current locale.
 */
private void setCurrentLocale(Locale locale) {
    if (locale.equals(mCurrentLocale)) {
        return;
    }

    mCurrentLocale = locale;

    mTempDate = getCalendarForLocale(mTempDate, locale);
    mMinDate = getCalendarForLocale(mMinDate, locale);
    mMaxDate = getCalendarForLocale(mMaxDate, locale);
    mCurrentDate = getCalendarForLocale(mCurrentDate, locale);

    mNumberOfMonths = mTempDate.getActualMaximum(Calendar.MONTH) + 1;
    mShortMonths = new String[mNumberOfMonths];
    for (int i = 0; i < mNumberOfMonths; i++) {
        mShortMonths[i] = DateUtils.getMonthString(Calendar.JANUARY + i,
                DateUtils.LENGTH_MEDIUM);
    }
}

 /**
 * Gets a calendar for locale bootstrapped with the value of a given calendar.
 *
 * @param oldCalendar The old calendar.
 * @param locale The locale.
 */
private Calendar getCalendarForLocale(Calendar oldCalendar, Locale locale) {
    if (oldCalendar == null) {
        return Calendar.getInstance(locale);
    } else {
        final long currentTimeMillis = oldCalendar.getTimeInMillis();
        Calendar newCalendar = Calendar.getInstance(locale);
        newCalendar.setTimeInMillis(currentTimeMillis);
        return newCalendar;
    }
}

So why does Locale.setDefault(Locale.GERMAN) not work?!
As you can see above I get the DatePicker from the XML.. is there any mistake?!

  • 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-06-17T11:57:47+00:00Added an answer on June 17, 2026 at 11:57 am

    You have to set the first day of week manually, for example in onCreate()/onCreateView() of your activity/fragment:

    date = (DatePicker) value.findViewById(R.id.date);
    if (Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB_MR1) {
        date.setSpinnersShown(false);
        date.setCalendarViewShown(true);
        date.getCalendarView().setFirstDayOfWeek(Calendar.getInstance().getFirstDayOfWeek());
    }
    

    The example above uses default locale (Calendar.getInstance() actually does), however you can specify the day manually:

    date.getCalendarView().setFirstDayOfWeek(Calendar.MONDAY);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a datepicker and I would like to disable the monday following the
I currently have datepicker only allowing Fridays. I would like to continue to only
I have an inline jquery ui datepicker that has some days disabled, like this
is there a way to have DatePicker allow user to only choose Sunday/Saturday from
I have a datepicker on my website but now I want to disable days
I have a datepicker, and I pick up two dates, like 2012-04-08 and 2012-05-11.
I currently have the DatePicker in my project but there are problems due to
Hey Guys, i have a big problem with my jQuery Datepicker Script. I use
I've got this answer working but I'd like to extend it: jQuery UI Datepicker
I have just upgraded to rails 3.2.1. I use the jQuery UI datepicker to

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.