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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:54:04+00:00 2026-05-23T14:54:04+00:00

So my widget pulls up correctly but it wont display the correct selection once

  • 0

So my widget pulls up correctly but it wont display the correct selection once the user has made a choice. Here is my code.

SimpleDateFormat dayFormatter = new SimpleDateFormat("EEEE, MMMM FF, yyyy");
Calendar cal = Calendar.getInstance();

This is run at the beginning of my code and when the widget get pulled up it displays the correct date. It might have something to do with why I have my original problem but I am at a lost and don’t know how to fix this.

DatePickerDialog.OnDateSetListener d=new DatePickerDialog.OnDateSetListener() {
    public void onDateSet(DatePicker view, int year, int monthOfYear,
            int dayOfMonth) {
        cal.set(Calendar.YEAR, year);
        cal.set(Calendar.MONTH, monthOfYear);
        cal.set(Calendar.DAY_OF_MONTH, dayOfMonth);

        int w = cal.get(Calendar.DAY_OF_WEEK);
        Date z = cal.getTime();
        description.setText(gDate.date(w, year, monthOfYear + 1, dayOfMonth) + 
                "\n" + dayFormatter.format(z));

And here is the output.

Monday, July 14, 2011

Monday, July 02, 2011

gDate.date(w, year, monthOfYear + 1, dayOfMonth)

This code above is a class I created to do this with a string before I learned about SimpleDateFormat. This is the string that is on top and displays the right date. Also I don’t understand why the second date starts where it is.

  • 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-23T14:54:05+00:00Added an answer on May 23, 2026 at 2:54 pm

    Change your pattern from "EEEE, MMMM FF, yyyy" to "EEEE, MMMM dd, yyyy"

    FF is day of week in month, dd is day in month. See the javadoc for SimpleDateFormat

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

Sidebar

Related Questions

Slashdot has a little widget that allows you to tweak your comment threshold to
I'm writing a widget that pulls data from a web page every 5 minutes,
I have a widget that periodically updates itself (hourly) to display top result of
The widget works fine in Firefox but it completely stops the page from being
I have a code snippet written in PHP that pulls a block of text
Hi all I have a 'widget' table that has the following columns: widget, action,
The organization I work for has created a small flash widget that we're encouraging
I have a repository on github, and someone else has forked it and made
My widget has a service attached to it to process various click commands which
class Widget { public: Widget() { cout<<~Widget()<<endl; } ~Widget() { cout<<~Widget()<<endl; } void* operator

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.