I have found a solution for this, here it is in case anybody else has the same issue:
Like Jay Bhatt pointed on a comment, date needs to be on right format. For Jquery Datepicker it should be something like this:
$( "#datepicker").datepicker({ dateFormat: 'yy-mm-dd' });
In my case, since I'm using Codeigniter, for the field to remember value should be:
value="<?php set_value('datepicker'); ?>
It wasn't working because I forgot to add $this->form_validation->set_rule() to that field in my Controller. Turns out that if you want CI's set_value() function to work, you need to set_rule() first. This was new for me.