Compare commits
2 Commits
c35608476f
...
51a0954b27
Author | SHA1 | Date | |
---|---|---|---|
51a0954b27 | |||
0cf05a0312 |
@ -8,8 +8,6 @@ the front page, smallest first.
|
||||
|
||||
# TODO
|
||||
|
||||
* make that part about sorting not be a lie
|
||||
* make that part about 48 hours not be a lie
|
||||
* continue to resist the urge to use the orange
|
||||
|
||||
# Author
|
||||
|
@ -22,8 +22,9 @@ func NewRequestHandlerSet(version string, db *gorm.DB) *RequestHandlerSet {
|
||||
}
|
||||
|
||||
func (r *RequestHandlerSet) indexHandler(c echo.Context) error {
|
||||
last24h := time.Now().Add(time.Second * 86400 * -1)
|
||||
var fpi []HNFrontPage
|
||||
r.db.Where("disappeared is not ?", time.Time{}).Order("disappeared desc").Find(&fpi)
|
||||
r.db.Where("disappeared is not ? and disappeared > ?", time.Time{}, last24h).Select("*, ( strftime('%s',disappeared) - strftime('%s',appeared)) as hangtime").Order("hangtime asc").Find(&fpi)
|
||||
|
||||
type fprow struct {
|
||||
Duration string
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="col-lg-12">
|
||||
|
||||
|
||||
<h2>Links Exiting The Front Page</h2>
|
||||
<h2>Links Exiting The Front Page <small>(last 24h)</small></h2>
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
|
Loading…
Reference in New Issue
Block a user