     step: moment.duration(5, 'second')
     previous: moment.duration(-1, 'hour')
     next: moment.duration(1, 'hour')
-})
+}
 
 #
 # moment datetimepicker directive.
 #
-module.directive 'momentDatetimepicker', ->
+module.directive 'momentDatetimepicker', ['dateTimePickerConfig', (defaultConfig)->
   return {
   scope: {
-    mdFormat: '&'     # moment format string use to format the current date.
     minDate: '=?'     # minimum selectionable date.
     maxDate: '=?'     # maximum selectionable date.
     currentView: '=?' #
+    mdFormat: '&'     # moment format string use to format the current date.
     commitView: '&'   #
     afterSelect: '&'
+    tokens: '&'
+    position: '=?'    # Default to ng-model.
+    selected: '=?'    # Hold the selection until commit.
+    activeBefore: '=?'
+    activeAfter: '=?'
   }
   require: 'ngModel'
   replace: true
   link: (scope, elm, attr, ngModel)->
-    scope.currentView = if scope.currentView? then 'year'
-    console.log scope
-
+    scope.currentView = 'year' if not scope.currentView?
+
+    # TODO: It might be possible to dynamicaly link pos and model using a watch on pos only if undefined.
+    # TODO: Maybe a better aproach is to have a setting attribute like "follow".
+    # TODO: Same thing with the commit thing.
+    followDate = false
+
+    #
+    # Used to calculate the next values
+    #
+    steps = defaultConfig
+
+    # This should be calculated D. M YYYY
+    scope.tokens = if not scope.tokens()? then [
+      {format: 'd', view: 'day'}
+      {format: '. '}
+      {format: 'MMMM', view: 'month'}
+      {format: ' '}
+      {format: 'yyyy', view: 'year'}
+    ] else scope.tokens()
 
     #
     # Helper functions returning the durations

          value: stepDate.toDate()
        }
        stepDate = moment(stepDate).add(period)
        newDate

      scope.stepsByWeek = splitByWeeks(scope.steps)




  }
]
