aboutsummaryrefslogtreecommitdiff
path: root/pkg/util/util.go
blob: 88d04c040cd0419e4f8743e6c24781180adc7c45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package util

import "time"

// StrContains searches for `needle` in `haystack` and returns `true` if found.
func StrContains(haystack []string, needle string) bool {
	for _, s := range haystack {
		if s == needle {
			return true
		}
	}

	return false
}

// TimeFormat formats the given time, where an empty time is formatted as "not set".
func TimeFormat(t time.Time) string {
	if t.IsZero() {
		return "not set"
	}

	return t.Format(time.ANSIC)
}
td>-32/+34 Moved all the function in backend.__init__ into the SystemWrapper class. And also make loading the real system lazy. Reason: So I do not need to care about whether anything imports the system before the MainWindow is started. 2009-10-08Enhance the splash window handling.René 'Necoro' Neumann2-2/+9 Now the splash window is forced to stay on top. Hopes no users are going to complain ;). Additionally, the splash window is destroyed opposed to only hidden. As it is not reused, there is no use in keeping it alive. (cherry picked from commit 0a30d24e34493a2f56ba801facf4daba711d363e) 2009-10-08Enhance the splash window handling.René 'Necoro' Neumann2-2/+9 Now the splash window is forced to stay on top. Hopes no users are going to complain ;). Additionally, the splash window is destroyed opposed to only hidden. As it is not reused, there is no use in keeping it alive. 2009-10-05Some more stuff to ignoreRené 'Necoro' Neumann1-0/+3 2009-10-05Renamed the ignore fileRené 'Necoro' Neumann1-0/+0 2009-10-05Update NEWSRené 'Necoro' Neumann1-0/+1 2009-10-05Also allow 'unselect all' in the PkgListRené 'Necoro' Neumann1-1/+10 2009-10-05Now have it the sorted way in PkgListsRené 'Necoro' Neumann2-3/+9 2009-10-05Enhanced system.sort_package_list to also sort CPVsRené 'Necoro' Neumann5-27/+38 2009-10-05Added an PkgList window and rewrote UpdateWindow and WorldListWindow to use itRené 'Necoro' Neumann3-39/+63 2009-10-05Add uninstall button and rename to PkgListWindowRené 'Necoro' Neumann1-2/+17 2009-10-05First quick hack to have a world listRené 'Necoro' Neumann3-2/+24