5

I have a Salesforce1 app that uses native HTML5 date(time) pickers. This wonderfully worked on all supported mobile platforms, on the desktop and in the one/one.app test page.

This morning (August 12th, 2014) it mysteriously stopped working on any Android phone.

To easily reproduce this I minimized my problem to this page:

<apex:page docType="html-5.0" standardController="CustomObject__c" >  
    <apex:form >
         <apex:inputfield value="{!CustomObject__c.DateTime__c}" 
                          type="datetime-local" 
                          showDatePicker="false" />                        
    </apex:form>    
</apex:page>

It even doesn't work with a pure html input tag:

    <input type="datetime-local"/>      
    <input type="datetime" />              
    <input type="date" />   

I checked that neighter my Android phone nor its browser was auto updated. I also did not activly update my Salesforce1 app.

Can anybody out there reproduce and explain this behaviour?!

EDIT: I am using a Google Nexus 5.

  • As silly as this sounds, have you tried totally signing out and signing back in to the SF1 app? – AlphaBravo Aug 12 '14 at 13:50
  • Yeah sound silly ;-) Sure we tried that! – Robert Sösemann Aug 12 '14 at 14:11
  • I opened case #10889926 with Salesforce support! – Robert Sösemann Aug 15 '14 at 10:56
3

It's ridiculous because HTML5 date input works in regular Android browsers so they did something extraordinary to break it. I'm surprised you say "recently", I've encountered it in June-July and for me it was always broken (testing on HTC ONe X):

I've ended up conditionally including the jQueryMobile's datepicker and displaying either native date picker or text field + jQ M enhancements based on User Agent.

Now, obligatory self-promoting snippet: I'm getting my feet wet in GitHub. Not the first OS project I decided to give a go but with repo containing only initial commit and funny name (my friend's idea) it doesn't look serious...

If you'd like to see my workaround: https://github.com/forceheroes/s1-widgets

3

SFDC Support(Case #10889926) told me:

Our R&D confirmed that this is already a known issue and is subjected to be fixed in Winter 15 release (around October, subject to change).

I have added the case BUG number to the case so that when the fix is released you would be notified on the same.

Please let me know if there are any further queries that needs to be addressed, And i would be happy to assist you with the same.

It's not published on their Known issues page but,

This is set to internal and not for customer facing, I would share the BUG number though "W-2122749"

This would be fixed with SF1 app version 6.0 which will be released in winter 15.

2

You are totally right. Sadly, the field it is working at all in Android. ( But it is working in iOS, browser... )

Just tested your version with a custom object and also with opportunity object ( in Android and in iOS) , however none of them are working in Android app.

I also got a nice error like : Unfortunately, Salesforce1 has stopped.! Maybe the best way to move forward now, could be contact SF support and let them know. (Maybe create a case with them) Sorry for the bad news :(

If you get it working please let me know! I'll keep an eye in the question!

Pleease see image below

-1

Try following code with modernizr to see if date inputs are supported, it will also alert the user agent of webview to give you more details:

<apex:page docType="html-5.0" standardController="Opportunity">  

<apex:includeScript value="https://dl.dropboxusercontent.com/u/1162324/test/modernizr.custom.35650.js"/>
<apex:form>
     Date : <apex:inputfield value="{!Opportunity.closedate}" 
                      type="date" 
                      showDatePicker="false" />                        
</apex:form>    

<script>
var debugInfo = 'UserAgent :' + navigator.userAgent + '\n\n\n';
debugInfo += (Modernizr.inputtypes.date ? 'Supports ' : 'Not Supports ') + ' Date Inputtype';
alert(debugInfo) ;


</script>

</apex:page>

BTW, I tried the same code on my Nexus 7 with and following is a screenshot of date picker coming fine and updating back as well.

So key question is which Android Device, OS and Browser you are on ?

Screenshot

  • 1
    iOS always worked. Android is the problem! – Robert Sösemann Aug 12 '14 at 14:10
  • 2
    Umm... will try on android device and update back... – Abhinav Gupta Aug 12 '14 at 14:25
  • @RobertSösemann added findings for Android as well in the post. – Abhinav Gupta Aug 13 '14 at 5:25
  • I am using a Google Nexus 5. – Robert Sösemann Aug 13 '14 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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