Hello,
startDate is a date when a task begins. Tasks can be
manually scheduled or automatically. In case of manually mode, task begins at its start date, so having start date valid is important. When a task is NOT manually scheduled, its start date can be differ from what it's set to. It depends on parent-child relation, dependencies, constraints, etc. Tasks are scheduled "forward" starting from the project start date as soon as possible. But you can set "exceptions" to this rule. For that constraints are used. For example you have a project that starts on Monday. And a subtask that you want to start not earlier than Wednesday. But there is no incoming dependencies to this task, there is nothing that can move this task to Wednesday. In this case you can set
constraintType to "startnoearlierthan" and
constraintDate to the Wednesday. That's it. Project will be rescheduled but the subtask will start not earlier than Wednesday. No matter what startDate is set to, because it will be rescheduled according to its constraint. The same behaviour you can see if you drag a task to the right for example. Please pay attention to the Constraint Type and Constraint Date columns:
- 2019-08-27_2030.png (270.22 KiB) Viewed 1040 times
Now back to your case, it's really hard to get what's wrong and what your goal is just base on the code snippets you provided. Could you please take one of our examples as a base, apply minimal changes to it to reproduce your issue, zip it up and attach here. Then please provide step-by-step instructions and your expectations about dates, calculation, etc on every step. Then we will have a context to help you with.
Best,
Pavel