Skip to content

Instantly share code, notes, and snippets.

@jkbryan
Created October 2, 2018 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkbryan/dc97df4e5aeefbcb479dcf4684a243a8 to your computer and use it in GitHub Desktop.
Save jkbryan/dc97df4e5aeefbcb479dcf4684a243a8 to your computer and use it in GitHub Desktop.
santizing-employeeenddate.vb
Case "employeeEndDate-CDRMA-PA-Import"
'CDR attributes required are: EndDate
'Code to define the employeeEndDate in the MV and Portal - needs to be in the correct format!
Dim dtFileTime As DateTime
If csentry("EndDate").IsPresent Then
dtFileTime = DateTime.Parse(csentry("EndDate").Value).Date
'Convert to the date/time string format that the Portal requires:
Dim employeeEndDate As String = dtFileTime.ToLocalTime.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'")
Dim arremployeeEndDate As String() = Split(employeeEndDate, "T")
employeeEndDate = arremployeeEndDate(0) & "T23:59:59.000"
mventry("employeeEndDate").Value = employeeEndDate
End If
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment