Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datetime support #12

Open
kratoon opened this issue Nov 25, 2020 · 0 comments
Open

Datetime support #12

kratoon opened this issue Nov 25, 2020 · 0 comments

Comments

@kratoon
Copy link

kratoon commented Nov 25, 2020

Currently no datetime is supported.

Something like this would be appreciated.
Also date literals would be great.

https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm

private static final String GMT_DATE_FORMAT = 'yyyy-MM-dd\'T\'HH:mm:ss\'Z\'';

public class CompareCondition extends FieldCondition {
        ....
        public Condition lt(Datetime fieldValue) {
            this.formedCondition = this.fieldName + ' < ' + fieldValue.formatGmt(GMT_DATE_FORMAT);
            return this;
        }

        public Condition gt(Datetime fieldValue) {
            this.formedCondition = this.fieldName + ' > ' + fieldValue.formatGmt(GMT_DATE_FORMAT);
            return this;
        }

        public Condition lte(Datetime fieldValue) {
            this.formedCondition = this.fieldName + ' <= ' + fieldValue.formatGmt(GMT_DATE_FORMAT);
            return this;
        }

        public Condition gte(Datetime fieldValue) {
            this.formedCondition = this.fieldName + ' >= ' + fieldValue.formatGmt(GMT_DATE_FORMAT);
            return this;
        }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant