function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
krishna1krishna1 

DatePicker issue

Hi All,

 

DatePicker date format is "5 December, 2013", how to compare with this datepicker date and object datetime field in query using apex ? Please guide me.

Bhawani SharmaBhawani Sharma
If you are comparing a date field with date time, time wont be ever matched. What you can do is:
Parse the date picker value and create a date instance:
like
Date.newInstance(year, month, day) and then convert your datetime field in date and compare.
krishna1krishna1

Hi Bhawani sharmi,

 

Please guide me how to parse this date like  '8 January, 2014'(came from jquery string format) formate to date instance? and camparing with datetime field.

 

Thanks

Bhawani SharmaBhawani Sharma
Split this variable by space and form a date from that. [8, 1, 2014]. Make
sure you write a method to get the month value from string.


Regards,
Bhavi Sharma
Certified Salesforce Consultant
bhavi@simplyforce.com/bhawani.sh.sharma@gmail.com
+91-9928130589
LinkedIn |
Twitter
| Blog |
Community
www.simplyforce.com
krishna1krishna1

Thank you Bhawani Sharma