txt: ## formatter.md
  formatter
  
  Combined from primary sources listed below.
  
  # [In role Dateish](#___top "go to top of document")[§](#(role_Dateish)_method_formatter "direct link")
  
  See primary documentation
  [in context](/type/Dateish#method_formatter)
  for **method formatter**.
  
  ```raku
  method formatter(Dateish:D:)
  ```
  
  Returns the formatting function which is used for conversion to [`Str`](/type/Str). If none was provided at object construction, a default formatter is used. In that case the method will return a Callable type object.
  
  The formatting function is called by [DateTime method Str](/type/DateTime#method_Str) with the invocant as its only argument.
  
  ```raku
  my $dt = Date.new('2015-12-31');  # (no formatter specified)
  say $dt.formatter.^name;          # OUTPUT: «Callable␤»
  my $us-format = sub ($self) { sprintf "%02d/%02d/%04d", .month, .day, .year given $self; };
  $dt = Date.new('2015-12-31', formatter => $us-format);
  say $dt.formatter.^name;           # OUTPUT: «Sub␤»
  say $dt;                          # OUTPUT: «12/31/2015␤»
  ```
  