The calendar control in ASP.NET - c#

Calendar Class
.NET Framework 2.0 Other Versions
Displays a single-month calendar that allows the user to select dates and move to the next or previous month.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Questions
By default which calender type does it use? (english,german,western,eastern etc i guess, or the servers bios settings time/date?)
Is it fully dependent on the systems clock settings? (well no explanation here yes or no? if yes then answer point 3)
Any way to provide web synchronization? (so that dependency on server time and date is removed)

1.not 100% what you mean, you can return it to string or datetime
2. dependent on the server time
3.not sure what you mean, you can store a date in a database and use that to set what date your calendar starts

Related

Get Timezone based on Selected place

In my MVC application I am selecting the company & doing my operations based on that.
as you can see in the Image below::
Here the problem is with the Timezone based on the company I have selected. Because I have to Insert the Datetime for the current Timezone.
We know in C# there are Inbuild properties like ::
DateTime.Now
DateTime.UtcNow
TimeZone.CurrentTimeZone
I just want the time based on companies selected from the above Dropdown in C#.
Please Help me on this,
Thanks in Advance.
You can get it by using Date.getTimezoneOffset(). This links might helps you.
http://aspdotnet-naresh.blogspot.in/2013/05/aspnet-how-to-convert-to-different-time.html
get client machine timezone in asp.net mvc
http://www.w3schools.com/jsref/jsref_getTimezoneOffset.asp
Get the default timezone for a country (via CultureInfo)
To start, I recommend http://nodatime.org, because they have some mapping functions from the more common Olson-format to the windows time zone format. Read more about this: Olson Time Zone Id to Windows Standard Format using Noda Time
To solve your problem, there are multiple options:
Save the name of the timezon in Olson format in your database.
Save the geolocation in your database. You can use the shape file with timezones to select the right timezone based on geolocations. http://efele.net/maps/tz/world/. There is also library to read this file: http://www.easygisdotnet.com/api/

How to retrieve latest publishing date of a page and modified date for current version using C# in Tridion 2011?

In one of my pages published from SDL Tridion 2011 CMS, there is a requirement to show the latest revision date (i.e. the date of current modified version of the page) and the last published date of page. Can anyone suggest how this can be achieved using SDL Tridion 2011 .
Given that your template code is being executed at publish time, to output the latest publish date in a ComponentPresentation or Page, you can just use DateTime.Now
As others have suggested access the Revision Date in the .Info classes.
If you are using DWT or XSLT templates you will either need to make a TBB to place this value in the package, and then output it with your Layout template, or use a custom Function Source to output the value directly.
But please specify what kind of templates you are using so we can give a fuller answer
Date/time at which the item was last modified
There is the RevisionDate property for Page public DateTime RevisionDate { get; }
DateTime at which the item was last published
There is the PublishedAt property in the PublishInfo class.

jQuery calendar in .net app

I have a table that has all the meeting schedules. I need to display the schedules in a Calendar on an Aspx page.
The calendar should:
allow the users to export the meetings to outlook
display time in different time zone specified in a dropdown list box.
have security based on different users' level of access (a field in the user table)
display in day, week, month, year.
display meetings in different colors for different meeting committees.
I use C#, .net 2.0, jQuery. Is there any existing code/add on that has already done this?
Thanks,
Fullcalendar will provide some of that functionality. I had to implement a similar calendar, and I used FullCalendar to provide the base functionality.
Day Pilot (Light) is free and open source. It doesn't do everything you need but at least you can expand on it. http://www.daypilot.org/demo/Lite/
DevExpress' Scheduler control would do most of this for you. It's not free though. Demos can be found here.

Is it possible to specify the time zone on Windows Azure?

I am going to migrating a system to Windows Azure. And it will used UTC time for all existing function. Is there any way to set the time zone globally? Or I need to change all the code which display the time? My application will mainly serve in a specified timezone.
I have try apply the culture and uiculture on web.config. And it does not work.
Thanks.
As per the Windows Azure Team Blog - all the timing calculations/display etc have been moved to UTC.. https://azure.microsoft.com/en-us/blog/moving-to-coordinated-universal-time-utc/
I feel you would need to change the code which display the time as well which saves the time as well..

How to put the build date of application somewhere in the application?

I would like to put the date the application was built somewhere in the application. Say the about box. Any ideas how this can be done? I need to do this for C# but I am also looking for a general idea, so you can answer this for any specific language other than C#.
Typically we just go with the executable's last modify date. This will be set when the exe is built and usually never changes (short of someone actually editing the file). When the file is installed, copied, moved, etc, Windows doesn't change that value.
DateTime buildDate =
new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
We use this technique for the about dialogs in our C# and C++ apps.
The third number of the assembly version is a julian date with 0=1 Jan 2000 if you're using [assembly: AssemblyVersion("1.0.*")]
e.g.
DateTime buildDate = new DateTime(2000,1,1).AddDays(
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build
);
You should be using version control - Subversion is free. Then you could include a number from the version control system that would unambiguously identify the source code used to build the app. A date won't do that. There are other advantages too.
Full history of all changes to the project.
Work seamlessly with other developers on the same project.
EDIT: Nikhil is already doing all this. But for some incomprehensible reason he has been told to include the date as well. I'm going to leave this answer here anyway, for future readers of this question.
There are usually keywords in your source code control system for this sort of thing.
Otherwise, look at including the date and time in the version number, or simply creating a small source code file which contains the date and time, and gets included in the build

Categories