5

Hi i am using drupal services 3 module. Every thing is perfect except updating date field. I tried many ways to update that field but didn't get any solution. Is any core issue related to date field?

8
  • Please add everything you've actually tried into the question, including code. Also add in all of the error messages you've received, what steps you've taken to debug the issue yourself, and what problems you've found there. It's impossible for us to debug your Drupal installation from here, so you'll need to add a lot more detail to your question if it's to be useful to future visitors, and subsequently remain open. If this is a bug report you need to take it to the Services module issue queue, we can't accept bug reports here. Thanks :)
    – Clive
    Commented Mar 19, 2013 at 15:10
  • I will update the code ASAP.
    – Sachin T
    Commented Mar 19, 2013 at 15:12
  • Thanks. To preempt that - no, there's no general problem with services and date fields, I use them all the time
    – Clive
    Commented Mar 19, 2013 at 15:19
  • @Clive, i am facing issues with date field too. they never get saved.
    – niksmac
    Commented Mar 19, 2013 at 15:20
  • @NikhilM Interesting, like I say I've never had a problem. I've literally just run one as a test and it worked fine...
    – Clive
    Commented Mar 19, 2013 at 15:22

1 Answer 1

7

it depends on the field widget how you submit your values for the service. For instance when you have a date field (datetime) with a select/dropdown widget, the form of the value should be the following:

"field_date":{"und":[{"value":{"month":"3","year":"2013","day":"6","hour":"0","minute":"0","second":"0"}}]},
3
  • 4
    Or for datetime picker... "field_date": { "und": [ { "value": { "date": "07/16/2013", "time": "11:14am" } } ] },
    – Brent
    Commented Jul 16, 2013 at 22:01
  • @30equals, your answer helped me determine what values to send via a URL data string, thanks! For example, "&node[field_date][und][0][value][year]=2013", works for a 'Date' field type that uses a 'Select list' widget and a 'Year' granularity. Commented Nov 20, 2013 at 5:14
  • @30equals, Can I post a timestamp format to drupal via android device?
    – Moon soon
    Commented Mar 23, 2014 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.