Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 23 | Rev 25 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 23 Rev 24
Línea 35... Línea 35...
35
        
35
        
36
        
36
        
Línea 37... Línea 37...
37
        let dateFormatter = DateFormatter()
37
        let dateFormatter = DateFormatter()
38
        dateFormatter.dateFormat = Constants.FORMAT_DATE_YMD
38
        dateFormatter.dateFormat = Constants.FORMAT_DATE_YMD
Línea 39... Línea 39...
39
        
39
        
40
        let sNow = dateFormatter.string(from: now)
40
        let sToday = dateFormatter.string(from: now)
Línea 57... Línea 57...
57
        var i : Int = 0
57
        var i : Int = 0
58
        var d : Date
58
        var d : Date
59
        var sDate : String
59
        var sDate : String
60
        while i < dates.count {
60
        while i < dates.count {
61
            sDate = dates[i]
61
            sDate = dates[i]
62
            d = dateFormatter.date(from: sDate) ?? Date()
62
            userNotificationGroupModel = UserNotificationGroupModel()
63
            
-
 
Línea -... Línea 63...
-
 
63
            
-
 
64
            switch sDate
-
 
65
            {
-
 
66
                case sToday :
-
 
67
                    userNotificationGroupModel.label = Config.LANG_COMMON_TODAY
-
 
68
                    break
-
 
69
                
-
 
70
                case sYesterday :
-
 
71
                    userNotificationGroupModel.label = Config.LANG_COMMON_YESTERDAY
-
 
72
                    break
-
 
73
                
-
 
74
                default :
-
 
75
                    d = dateFormatter.date(from: sDate) ?? Date()
-
 
76
                    userNotificationGroupModel.label = showFormatter.string(from: d)
-
 
77
                    break
-
 
78
                
-
 
79
            }
Línea 64... Línea -...
64
            
-
 
65
            
-
 
-
 
80
           
66
            userNotificationGroupModel = UserNotificationGroupModel()
81
            
Línea 67... Línea 82...
67
            userNotificationGroupModel.label = showFormatter.string(from: d)
82
           
Línea 68... Línea 83...
68
            userNotificationGroupModel.notifications = userNotificationDao.selectAllByUserUuidAndDate(userUuid: appData.userUuid, date: sDate)
83
            userNotificationGroupModel.notifications = userNotificationDao.selectAllByUserUuidAndDate(userUuid: appData.userUuid, date: sDate)
Línea 83... Línea 98...
83
            groups[i].notifications.remove(at:  groups[i].notifications.firstIndex(where: {  $0.id == id })!)
98
            groups[i].notifications.remove(at:  groups[i].notifications.firstIndex(where: {  $0.id == id })!)
Línea 84... Línea 99...
84
        
99
        
85
            i += 1
100
            i += 1
Línea -... Línea 101...
-
 
101
        }
-
 
102
        
-
 
103
        i = groups.count - 1
-
 
104
        while i > 0 {
-
 
105
            if groups[i].notifications.count == 0 {
-
 
106
                groups.remove(at: i)
-
 
107
            }
-
 
108
        
-
 
109
            i -= 1
Línea 86... Línea 110...
86
        }
110
        }
Línea 87... Línea 111...
87
        
111