0

I'm using the Sitecore Scheduled Publish with the Timezone package from https://marketplace.sitecore.net/Modules/S/Sitecore_Scheduled_Publish.aspx developed by Hedgehog.

This allow me to add some timezone, but is it possible to add the India timezone utc +05:30? I get a error in the scheduled publish dialog when I use +5:30 or +5.5 seem like it is only working for whole hours?

Exception: System.FormatException Message: Input string was not in a correct format. Source: mscorlib at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at ScheduledPublish.Models.TimeZone.get_Offset() at ScheduledPublish.sitecore.shell.Applications.Content_Manager.Dialogs.Schedule_Publish.SchedulePublishDialog.PublishDateTimePickerOnChanged(Object sender, EventArgs eventArgs) at Sitecore.Web.UI.HtmlControls.DateTimePicker.OnChanged() at Sitecore.Web.UI.HtmlControls.DatePicker.DoChanged() at Sitecore.Web.UI.HtmlControls.DatePicker.HandleMessage(Message message) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.DispatchMessage(Control control) at Sitecore.Shell.Framework.Commands.MessageCommand.Execute(CommandContext context) at Sitecore.Web.UI.Sheer.ClientPage.SendMessage(Message message) at Sitecore.Web.UI.HtmlControls.DateCalendar.OnSelect() at Sitecore.Web.UI.HtmlControls.DateCalendar.DoClick(Message message)

  • 1
    What is the error? You have a stack trace? – Richard Seal Feb 28 at 13:57
1

No this is not possible. (without changing the code)

In the Model (ScheduledPublish.Models.Offset) there is an int.Parse. so the value needs to be an integer.

Looks like the source is also not on GitHub. Although there is a feature-timezones branch https://github.com/HedgehogDevelopment/SCScheduledPublishing/tree/feature-timezones it seems like it is not about this timezone feature.

Also on GitHub is a newer version of the module version 1.1 instead of the 1.0 on the marketplace. but the timezone feature from this issue is not in there.

What you can do is de-compile the code, and change the model to

public double Offset
{
    get
    {
        return double.Parse(this.InnerItem[ID.Parse("{32BF3544-E4F1-4A09-80ED-CC654BD6A764}")]);
    }
}

This works, (the module is under the Apache License) the code to display is

universalTime.AddHours((double) timeZone.Offset).ToShortTimeString())

For UTC+5:30 you can now use

5.5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.