fixed dates formatting macros, fixed statemanager when using contexts in...

...stead of pages