Adress-Modul erstellt
This commit is contained in:
@@ -32,4 +32,30 @@ f_reactable <- function(daten, coldefs = NULL, selection = "single",
|
||||
onClick = "select",
|
||||
columns = coldefs
|
||||
)
|
||||
}
|
||||
|
||||
f_reactable_sub <- function(daten, coldefs = NULL) {
|
||||
reactable(
|
||||
daten,
|
||||
selection = "single",
|
||||
pagination = T,
|
||||
defaultPageSize = 17,
|
||||
showPageSizeOptions = TRUE,
|
||||
filterable = TRUE,
|
||||
highlight = TRUE,
|
||||
bordered = TRUE,
|
||||
striped = FALSE,
|
||||
compact = TRUE,
|
||||
# Styling
|
||||
theme = reactableTheme(
|
||||
highlightColor = "#e6f7ff", # Etwas dezenter als knallgrün, optional
|
||||
# borderColor = "#dfe2e5",
|
||||
rowSelectedStyle = list(backgroundColor = "#98F5FF")#
|
||||
),
|
||||
rowStyle = function(index) {
|
||||
style <- list(cursor = "pointer") # immer aktiv
|
||||
},
|
||||
onClick = "select",
|
||||
columns = coldefs
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
##
|
||||
## Datum: 2024-10-17_14-31
|
||||
## Name: Christian Oswald
|
||||
## Projekt: etatverwaltung
|
||||
## Datei: f_zeitstempel.R
|
||||
## Kommentar: Erstellt einen Zeitstempel für die DB-Felder updatea und created
|
||||
##
|
||||
|
||||
# Funkton die prüft ob das Format stimmt
|
||||
is.ymd_hms <- function(x) !is.na(lubridate::ymd_hms(x, quiet = TRUE))
|
||||
# Zeitstempel
|
||||
f_zeitstempel <- function(ts){
|
||||
# Erstellt einen wenn leer
|
||||
if(is.na(ts)) ts <- format(Sys.time(), tz="")
|
||||
# Erstellt einen wenn das Format nicht stimmt
|
||||
if(!is.ymd_hms(ts)) ts <- format(Sys.time(), tz="")
|
||||
return(ts)
|
||||
}
|
||||
Reference in New Issue
Block a user