mirror of
https://github.com/unraid/api.git
synced 2026-01-04 23:50:37 -06:00
fix: update os check modal ineligible date format
This commit is contained in:
@@ -49,9 +49,20 @@ const {
|
||||
checkForUpdatesLoading,
|
||||
} = storeToRefs(updateOsStore);
|
||||
|
||||
const {
|
||||
outputDateTimeFormatted: formattedRegExp,
|
||||
} = useDateTimeHelper(dateTimeFormat.value, props.t, true, regExp.value);
|
||||
/**
|
||||
* regExp may not have a value until we get a response from the refreshServerState action
|
||||
* So we need to watch for this value to be able to format it based on the user's date time preferences.
|
||||
*/
|
||||
const formattedRegExp = ref<any>();
|
||||
const setFormattedRegExp = () => { // ran in watch on regExp and onBeforeMount
|
||||
if (!regExp.value) { return; }
|
||||
|
||||
const { outputDateTimeFormatted } = useDateTimeHelper(dateTimeFormat.value, props.t, true, regExp.value);
|
||||
formattedRegExp.value = outputDateTimeFormatted.value;
|
||||
};
|
||||
watch(regExp, (_newV) => {
|
||||
setFormattedRegExp();
|
||||
});
|
||||
|
||||
const ignoreThisRelease = ref(false);
|
||||
// if we had a release ignored and now we don't set ignoreThisRelease to false
|
||||
@@ -208,6 +219,7 @@ onBeforeMount(() => {
|
||||
if (availableReleaseDate.value) {
|
||||
setUserFormattedReleaseDate();
|
||||
}
|
||||
setFormattedRegExp();
|
||||
});
|
||||
|
||||
const modalWidth = computed(() => {
|
||||
|
||||
@@ -33,6 +33,22 @@ const timeFormatOptions: TimeFormatOption[] = [
|
||||
];
|
||||
|
||||
/**
|
||||
* the provided ref may not have a value until we get a response from the refreshServerState action
|
||||
* So we need to watch for this value to be able to format it based on the user's date time preferences.
|
||||
* @example below is how to use this composable
|
||||
* const formattedRegExp = ref<any>();
|
||||
* const setFormattedRegExp = () => { // ran in watch on regExp and onBeforeMount
|
||||
* if (!regExp.value) { return; }
|
||||
* const { outputDateTimeFormatted } = useDateTimeHelper(dateTimeFormat.value, props.t, true, regExp.value);
|
||||
* formattedRegExp.value = outputDateTimeFormatted.value;
|
||||
* };
|
||||
* watch(regExp, (_newV) => {
|
||||
* setFormattedRegExp();
|
||||
* });
|
||||
* onBeforeMount(() => {
|
||||
* setFormattedRegExp();
|
||||
* });
|
||||
*
|
||||
* @param format provided by Unraid server's state.php and set in the server store
|
||||
* @param t translations
|
||||
* @param hideMinutesSeconds true will hide minutes and seconds from the output
|
||||
|
||||
Reference in New Issue
Block a user