BUG: agg() function on groupby dataframe changes dtype of datetime64[ns] column to float64 
closes #12821 
closes #12941

can you rebase / update
 Sorry, @jreback.

This month I was far busy than expected, and I'm planning to fix the bug on next Sunday.
 ## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/12992?src=pr) is 85.30% (diff: 100%)

> Merging [#12992](https://codecov.io/gh/pydata/pandas/pull/12992?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will decrease coverage by **<.01%**

``` diff
@@             master     #12992   diff @@
==========================================
  Files           139        139          
  Lines         50138      50140     +2   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          42769      42770     +1   
- Misses         7369       7370     +1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [3186fef...607a170](https://codecov.io/gh/pydata/pandas/compare/3186fef545b55ca7b4a3c79c800f32b1d586545e...607a170563bdc56a3df3d064325b75b5a446bd9f?src=pr)
 can you rebase / update?
 does this also address #12941  ?

pls rebase / small update as well. ping on green.
 Hi, I have fixed #12941 and rebase again.
 ok looks good. pls rebase / squash (and build failed).
 rebase again.
 can you rebase and i'll review
 can you rebase. ping when green.
 @jreback, hi, agg function will eat up Name, is it a bug?
 not sure can u show s complete example
 ``` python
In [12]: df = pd.Series(range(5)).to_frame()

In [13]: df
Out[13]:
   0
0  0
1  1
2  2
3  3
4  4

In [14]: df.min()
Out[14]:
0    0
dtype: int64

In [15]: df.loc[0]
Out[15]:
0    0
Name: 0, dtype: int64
```
 Giving a slightly more clear example. I suppose this could be done. Though its only for a very limited number of reducers, prob just min/max. For example, anything that does an aggregation like `.sum/.mean` this by-definition obliterates the index. Pls make a new issue and list the functions you think should be changed here.

```
In [19]: df = pd.Series(range(5),index=list('abcde')).to_frame(name='foo')

In [20]: df
Out[20]: 
   foo
a    0
b    1
c    2
d    3
e    4

In [21]: df.loc['a']
Out[21]: 
foo    0
Name: a, dtype: int64

In [22]: df.min()
Out[22]: 
foo    0
dtype: int64

```
 @jreback Hi, I'll submit a issue later. And all checks have passed, so do you think that the pr is ok?
 @jreback all checks have passed.
 lgtm. pls rebase and ping on green.
 @jreback Both #12821  and #12941 are fixed in the PR. The two bugs behave similarity, while they are located in different code. And all checks have passed.
 thanks!
 @ningchi can you have a look at these, see if they are _also_ closed (so maybe just need some validation tests).

xref #8617 (might be a duplicate)
xref #4147
 Ok
 It seems that #8617 has been fixed, while #4147 behaves differently now. 
