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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:09:20+00:00 2026-06-16T16:09:20+00:00

Problem: Get a date inside of a JSONP response that looks like 2012-11-11T04:27:25Z (which

  • 0

Problem: Get a date inside of a JSONP response that looks like “2012-11-11T04:27:25Z” (which is the default date output from a Rails app) into a date field in a model instance in a Sencha Touch 2 app without it being an Invalid date.

Background: I have a Rails app that is generating JSONP, which I read into a Store in my Sencha Touch 2 app, and the date, as formatted by Rails comes into the Sencha Touch 2 app as an Invalid Date.

To reproduce: To reproduce the problem for this question and duplicate the error, use the Fiddle below. Note: I took the Rails server out of the picture by hard-wiring the data into a store with a date formatted the same way my Rails app has been outputting them. So, in other words, I have reproduced the entire problem locally in the Sencha Touch 2 app by mimicking what my Rails app does server-side.

Fiddle: http://www.senchafiddle.com/#7qQkb. To see the problem, run the Fiddle from a Webkit browser and view the JavaScript console inside the Webkit Developer Tools.

Symptom: What will happen is that the XTemplate that is created by the List component within the app executes code (inside {[]} brackets) to output a date for your inspection in the console. When you inspect the date that is outputted, you will see: __proto__: Invalid Date. The date will still show up just fine in the view, but because it is an invalid date, I cannot format the date or retrieve different parts of the date object.

My question is this: Is there something that I can do to my model or my store, or alternatively to my Rails app, to get the date into a model instance without it being an Invalid Date?

  • 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-16T16:09:22+00:00Added an answer on June 16, 2026 at 4:09 pm

    What you see is just the returned value of toString method in the Date prototype

    Date.prototype.toString(); // "Invalid Date"
    

    That´s why absolutly all the “dates” say exactly the samething. However, it doesn´t mean date are wrong! In extjs, if you want to format a date field in you model you should use:

    { name: 'timestamp', type: 'date', dateFormat: "Y-m-d H:i" }
    

    But if you only want to format it to display it, you can use the format yo used, one of the named built-in format or just the sameone I used in the example: Y-m-d H:i

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

Sidebar

Related Questions

I have the following problem. I wrote a query to get the date of
I have two MultiWidget one inside the other, but the problem is that the
This function doesn't work and I can't find the problem, which is somewhere inside
My problem is that memcache logic inside my cakePHP application is not working on
I've read here on Stackoverflow that paths inside the file could be a problem,
Problem: To get the index values of an array to print accordingly in value
Problem: to get the command working here. My domain is http://cs.edu.com/user/share_dir , but I
Hi I get problem retrieve XML data from SQL2000 server. The table structure is
I have some problem to get the utf-8 string from PHP using jQuery $.load()
I am having problem to get a numerical value for this expression where I

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.