You've already forked AstralRinth
forked from didirus/AstralRinth
Fix gallery date display (#445)
* Fix gallery date display * Fix approved date not setting
This commit is contained in:
@@ -121,7 +121,13 @@ impl ids::ProjectTypeId {
|
||||
}
|
||||
|
||||
pub fn convert_postgres_date(input: &str) -> DateTime<Utc> {
|
||||
DateTime::parse_from_str(input, "%Y-%m-%d %T%#z")
|
||||
let mut result = DateTime::parse_from_str(input, "%Y-%m-%d %T.%f%#z");
|
||||
|
||||
if result.is_err() {
|
||||
result = DateTime::parse_from_str(input, "%Y-%m-%d %T%#z")
|
||||
}
|
||||
|
||||
result
|
||||
.map(|x| x.with_timezone(&Utc))
|
||||
.unwrap_or_else(|_| Utc::now())
|
||||
}
|
||||
|
||||
@@ -507,7 +507,7 @@ pub async fn project_edit(
|
||||
"
|
||||
UPDATE mods
|
||||
SET approved = NOW()
|
||||
WHERE id = $1 AND approved = NULL
|
||||
WHERE id = $1 AND approved IS NULL
|
||||
",
|
||||
id as database::models::ids::ProjectId,
|
||||
)
|
||||
|
||||
@@ -16,7 +16,14 @@ impl super::Validator for PluginYmlValidator {
|
||||
}
|
||||
|
||||
fn get_supported_loaders(&self) -> &[&str] {
|
||||
&["bukkit", "spigot", "paper", "purpur", "bungeecord", "waterfall"]
|
||||
&[
|
||||
"bukkit",
|
||||
"spigot",
|
||||
"paper",
|
||||
"purpur",
|
||||
"bungeecord",
|
||||
"waterfall",
|
||||
]
|
||||
}
|
||||
|
||||
fn get_supported_game_versions(&self) -> SupportedGameVersions {
|
||||
|
||||
Reference in New Issue
Block a user